Hi Bruno,

I have never used 3.6 so I am sorry I might not be of much help.
But, I have a similar requirement for 2 fields and I use string & case
insensitive string fields and by escaping the forward slash, I get the
result correctly.

The field definitions are as below:

<fieldType name="string" class="solr.StrField" sortMissingLast="true"
omitNorms="true" compressThreshold="10"/>

<fieldType name="string_ci" class="solr.TextField" sortMissingLast="true"
omitNorms="true" compressThreshold="10">
    <analyzer>
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
     </analyzer>
 </fieldType>

The debug output for string field is as below:

*String field:*

<str name="rawquerystring">pv_program_version_number_ci:HNAD002D\/01</str>
<str name="querystring">pv_program_version_number_ci:HNAD002D\/01</str>
<str name="parsedquery">pv_program_version_number_ci:hnad002d/01</str>
<str name="parsedquery_toString">pv_program_version_number_ci:hnad002d/01
</str>

*Case Insensitive String field:*
<str name="rawquerystring">pv_program_version_number:HNAD002D\/01</str>
<str name="querystring">pv_program_version_number:HNAD002D\/01</str>
<str name="parsedquery">pv_program_version_number:HNAD002D/01</str>
<str name="parsedquery_toString">pv_program_version_number:HNAD002D/01</str>


HTH,
Sandeep


On 19 February 2013 12:24, Bruno Mannina <bmann...@free.fr> wrote:

> Hi,
>
> Even I use backslash, the problem is the same:
> ic:A01H2\/023 returns the same problem.
>
> May be I must disable an option ? or something ....
>
> Le 19/02/2013 13:11, Bruno Mannina a écrit :
>
>  Hi Sandeep,
>>
>> First thanks for your answer but I use Solr 3.6 and not 4.0.
>> I can't actually update my solr to 4.0 version.
>>
>> And using the " " is not the solution because Solr 3.6 has an issue when
>> I use troncation like * inside the request:
>> "A01H2/0*" doesn't work.
>>
>> Do you have an other solution for Solr 3.6 ?
>>
>> thanks a lot,
>> Bruno
>>
>> Le 19/02/2013 13:05, Sandeep Mestry a écrit :
>>
>>> Hi Bruno,
>>>
>>> [image: <!>] Solr 4.0 added regular expression support, which means that
>>> '/' is now a special character and must be escaped if searching for
>>> literal
>>> forward slash.
>>>
>>> http://wiki.apache.org/solr/**SolrQuerySyntax<http://wiki.apache.org/solr/SolrQuerySyntax>
>>>
>>> So, you can either escape it or use quotes like "A01H2/001"
>>>
>>> Cheers,
>>> Sandeep
>>>
>>>
>>>
>>> On 19 February 2013 11:40, Bruno Mannina <bmann...@free.fr> wrote:
>>>
>>>  Dear Solr Users,
>>>>
>>>> I use Solr 3.6
>>>>
>>>> I have a field name IC which contains IPC codes with a forward slash
>>>> inside like:
>>>> A01H2/001
>>>> G06F1/023
>>>> C01C3/147
>>>> G06F3/023
>>>> etc...
>>>>
>>>> My definition for this field is:
>>>> <field name="ic" type="text_general" indexed="true" stored="true"
>>>> multiValued="true"/>
>>>>
>>>> If i try to search:
>>>> ic:G06F3/023
>>>> http://xxxxxxxx:yyyy/solr/****select/?q=ic%3AG06F3%2F023&**
>>>> version=2.2&start=0&rows=10&****indent=on
>>>>
>>>> the result is wrong.
>>>>
>>>> When I use debugQuery, I see that the forward slash split the request
>>>> as:
>>>> <str name="parsedquery_toString">****ic:g06f3 ic:023</str>
>>>>
>>>> How can I search a term that contains a / (forward slash)?
>>>>
>>>> Thanks a lot for your help,
>>>> Bruno
>>>>
>>>>
>>>>
>>>>
>>>>
>>
>>
>>
>

Reply via email to