Issue while searching with escape characters

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue while searching with escape characters

Roopesh Uniyal
Hello I am searching Solr 6 via http call by providing a "UserID".

Its just that the data is in the format of (DVeto1)

So, in my call I have to provide parenthesis but since its a special
character I need to provide escape also. Looks like its not working

Provided the search string over http like these but none worked -

(DVeto1)
\(DVeto1\)

Since this is not working I am sure I am missing something. Will appreciate
your inputs.

Thanks!
Reply | Threaded
Open this post in threaded view
|

Antwort: Issue while searching with escape characters

Jan.Christopher.Schluchtmann-EXT
hmm ... it seems, you are using XML/HTML-encoding, but you need
HTTP-encoding, which looks like this:


␣      !       "       #       $       %       &       '       (       )
*       +       ,       -       .       /       :       ;       <       =
>       ?       @       [       \       ]       {       |       }

%20     %21     %22     %23     %24     %25     %26     %27     %28 %29
%2A     %2B     %2C     %2D     %2E     %2F     %3A     %3B     %3C %3D
%3E     %3F     %40     %5B     %5C     %5D     %7B     %7C     %7D


good luck! :)


Mit freundlichen Grüßen/ With kind regards

Jan Schluchtmann
Systems Engineering Cluster Instruments
VW Group
Continental Automotive GmbH
Division Interior
ID S3 RM
VDO-Strasse 1, 64832 Babenhausen, Germany

Telefon/Phone: +49 6073 12-4346
Telefax: +49 6073 12-79-4346



Von:    Roopesh Uniyal <[hidden email]>
An:     [hidden email],
Datum:  06.12.2017 09:57
Betreff:        Issue while searching with escape characters



Hello I am searching Solr 6 via http call by providing a "UserID".

Its just that the data is in the format of (DVeto1)

So, in my call I have to provide parenthesis but since its a special
character I need to provide escape also. Looks like its not working

Provided the search string over http like these but none worked -

&#40;DVeto1&#41;
&#92;&#40;DVeto1&#92;&#41;

Since this is not working I am sure I am missing something. Will
appreciate
your inputs.

Thanks!


Reply | Threaded
Open this post in threaded view
|

Re: Issue while searching with escape characters

Roopesh Uniyal
Thanks Jan. It must be a late night. Not sure what I was thinking.

I provided *%5C%28DVeto1%5C%29* but still not able to get the search results

I also have a situation where I have to search something like *(ID#DVeto2)*
and I am providing *%5C%28ID%23DVeto2%5C%2*9 and still not able to get the
resultsets.

Its not throwing any error but no result found in these two scenarios.
Although we know there should be some records.

Am I missing anything?

Thanks!


On Wed, Dec 6, 2017 at 4:13 AM, <
[hidden email]> wrote:

> hmm ... it seems, you are using XML/HTML-encoding, but you need
> HTTP-encoding, which looks like this:
>
>
> ␣      !       "       #       $       %       &       '       (       )
> *       +       ,       -       .       /       :       ;       <       =
> >       ?       @       [       \       ]       {       |       }
>
> %20     %21     %22     %23     %24     %25     %26     %27     %28 %29
> %2A     %2B     %2C     %2D     %2E     %2F     %3A     %3B     %3C %3D
> %3E     %3F     %40     %5B     %5C     %5D     %7B     %7C     %7D
>
>
> good luck! :)
>
>
> Mit freundlichen Grüßen/ With kind regards
>
> Jan Schluchtmann
> Systems Engineering Cluster Instruments
> VW Group
> Continental Automotive GmbH
> Division Interior
> ID S3 RM
> VDO-Strasse 1, 64832 Babenhausen, Germany
>
> Telefon/Phone: +49 6073 12-4346
> Telefax: +49 6073 12-79-4346
>
>
>
> Von:    Roopesh Uniyal <[hidden email]>
> An:     [hidden email],
> Datum:  06.12.2017 09:57
> Betreff:        Issue while searching with escape characters
>
>
>
> Hello I am searching Solr 6 via http call by providing a "UserID".
>
> Its just that the data is in the format of (DVeto1)
>
> So, in my call I have to provide parenthesis but since its a special
> character I need to provide escape also. Looks like its not working
>
> Provided the search string over http like these but none worked -
>
> &#40;DVeto1&#41;
> &#92;&#40;DVeto1&#92;&#41;
>
> Since this is not working I am sure I am missing something. Will
> appreciate
> your inputs.
>
> Thanks!
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Issue while searching with escape characters

Emir Arnautović
Hi,
You need to escape special chars with \ and if you are sending it in URL you can URL encode it, but that is URL related thing not Solr.

Here is the list of Lucene characters that need to be escaped: http://lucene.apache.org/core/7_1_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#Escaping_Special_Characters <http://lucene.apache.org/core/7_1_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#Escaping_Special_Characters>

HTH,
Emir
--
Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training - http://sematext.com/



> On 6 Dec 2017, at 10:33, Roopesh Uniyal <[hidden email]> wrote:
>
> Thanks Jan. It must be a late night. Not sure what I was thinking.
>
> I provided *%5C%28DVeto1%5C%29* but still not able to get the search results
>
> I also have a situation where I have to search something like *(ID#DVeto2)*
> and I am providing *%5C%28ID%23DVeto2%5C%2*9 and still not able to get the
> resultsets.
>
> Its not throwing any error but no result found in these two scenarios.
> Although we know there should be some records.
>
> Am I missing anything?
>
> Thanks!
>
>
> On Wed, Dec 6, 2017 at 4:13 AM, <
> [hidden email]> wrote:
>
>> hmm ... it seems, you are using XML/HTML-encoding, but you need
>> HTTP-encoding, which looks like this:
>>
>>
>> ␣      !       "       #       $       %       &       '       (       )
>> *       +       ,       -       .       /       :       ;       <       =
>>>      ?       @       [       \       ]       {       |       }
>>
>> %20     %21     %22     %23     %24     %25     %26     %27     %28 %29
>> %2A     %2B     %2C     %2D     %2E     %2F     %3A     %3B     %3C %3D
>> %3E     %3F     %40     %5B     %5C     %5D     %7B     %7C     %7D
>>
>>
>> good luck! :)
>>
>>
>> Mit freundlichen Grüßen/ With kind regards
>>
>> Jan Schluchtmann
>> Systems Engineering Cluster Instruments
>> VW Group
>> Continental Automotive GmbH
>> Division Interior
>> ID S3 RM
>> VDO-Strasse 1, 64832 Babenhausen, Germany
>>
>> Telefon/Phone: +49 6073 12-4346
>> Telefax: +49 6073 12-79-4346
>>
>>
>>
>> Von:    Roopesh Uniyal <[hidden email]>
>> An:     [hidden email],
>> Datum:  06.12.2017 09:57
>> Betreff:        Issue while searching with escape characters
>>
>>
>>
>> Hello I am searching Solr 6 via http call by providing a "UserID".
>>
>> Its just that the data is in the format of (DVeto1)
>>
>> So, in my call I have to provide parenthesis but since its a special
>> character I need to provide escape also. Looks like its not working
>>
>> Provided the search string over http like these but none worked -
>>
>> &#40;DVeto1&#41;
>> &#92;&#40;DVeto1&#92;&#41;
>>
>> Since this is not working I am sure I am missing something. Will
>> appreciate
>> your inputs.
>>
>> Thanks!
>>
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: Issue while searching with escape characters

Roopesh Uniyal
Thanks Emir & Jan!

I have a situation where I need to search a field value is
between parenthesis () like - *(DVeto1)*

Based on the documentation
<http://lucene.apache.org/core/7_1_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#Escaping_Special_Characters>
parenthesis just need escape character but no matter what way I provide it,
its not providing resultset.

%28*DVeto1*%29
%5C%28*DVeto1*%5C%29
%22%28%22*DVeto1*%22%29%22
%22%5C%28%22*DVeto1*%22%5C%29%22


Thanks,
Roopesh

On Wed, Dec 6, 2017 at 7:44 AM, Emir Arnautović <
[hidden email]> wrote:

> Hi,
> You need to escape special chars with \ and if you are sending it in URL
> you can URL encode it, but that is URL related thing not Solr.
>
> Here is the list of Lucene characters that need to be escaped:
> http://lucene.apache.org/core/7_1_0/queryparser/org/apache/
> lucene/queryparser/classic/package-summary.html#Escaping_
> Special_Characters <http://lucene.apache.org/core/7_1_0/queryparser/org/
> apache/lucene/queryparser/classic/package-summary.html#
> Escaping_Special_Characters>
>
> HTH,
> Emir
> --
> Monitoring - Log Management - Alerting - Anomaly Detection
> Solr & Elasticsearch Consulting Support Training - http://sematext.com/
>
>
>
> > On 6 Dec 2017, at 10:33, Roopesh Uniyal <[hidden email]>
> wrote:
> >
> > Thanks Jan. It must be a late night. Not sure what I was thinking.
> >
> > I provided *%5C%28DVeto1%5C%29* but still not able to get the search
> results
> >
> > I also have a situation where I have to search something like
> *(ID#DVeto2)*
> > and I am providing *%5C%28ID%23DVeto2%5C%2*9 and still not able to get
> the
> > resultsets.
> >
> > Its not throwing any error but no result found in these two scenarios.
> > Although we know there should be some records.
> >
> > Am I missing anything?
> >
> > Thanks!
> >
> >
> > On Wed, Dec 6, 2017 at 4:13 AM, <
> > [hidden email]> wrote:
> >
> >> hmm ... it seems, you are using XML/HTML-encoding, but you need
> >> HTTP-encoding, which looks like this:
> >>
> >>
> >> ␣      !       "       #       $       %       &       '       (       )
> >> *       +       ,       -       .       /       :       ;       <
>  =
> >>>      ?       @       [       \       ]       {       |       }
> >>
> >> %20     %21     %22     %23     %24     %25     %26     %27     %28 %29
> >> %2A     %2B     %2C     %2D     %2E     %2F     %3A     %3B     %3C %3D
> >> %3E     %3F     %40     %5B     %5C     %5D     %7B     %7C     %7D
> >>
> >>
> >> good luck! :)
> >>
> >>
> >> Mit freundlichen Grüßen/ With kind regards
> >>
> >> Jan Schluchtmann
> >> Systems Engineering Cluster Instruments
> >> VW Group
> >> Continental Automotive GmbH
> >> Division Interior
> >> ID S3 RM
> >> VDO-Strasse 1, 64832 Babenhausen, Germany
> >>
> >> Telefon/Phone: +49 6073 12-4346
> >> Telefax: +49 6073 12-79-4346
> >>
> >>
> >>
> >> Von:    Roopesh Uniyal <[hidden email]>
> >> An:     [hidden email],
> >> Datum:  06.12.2017 09:57
> >> Betreff:        Issue while searching with escape characters
> >>
> >>
> >>
> >> Hello I am searching Solr 6 via http call by providing a "UserID".
> >>
> >> Its just that the data is in the format of (DVeto1)
> >>
> >> So, in my call I have to provide parenthesis but since its a special
> >> character I need to provide escape also. Looks like its not working
> >>
> >> Provided the search string over http like these but none worked -
> >>
> >> &#40;DVeto1&#41;
> >> &#92;&#40;DVeto1&#92;&#41;
> >>
> >> Since this is not working I am sure I am missing something. Will
> >> appreciate
> >> your inputs.
> >>
> >> Thanks!
> >>
> >>
> >>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Issue while searching with escape characters

Emir Arnautović
Hi Roopesh,
What are *? Is it wildcard or special char as well? Examples that you provided are  not what you said you want to search - * are not on the same position. If you are not finding anything, that can be due to your analysis - are you sure that your analysis does not trim parenthesis?

Regards,
Emir
--
Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training - http://sematext.com/



> On 6 Dec 2017, at 16:13, Roopesh Uniyal <[hidden email]> wrote:
>
> Thanks Emir & Jan!
>
> I have a situation where I need to search a field value is
> between parenthesis () like - *(DVeto1)*
>
> Based on the documentation
> <http://lucene.apache.org/core/7_1_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#Escaping_Special_Characters>
> parenthesis just need escape character but no matter what way I provide it,
> its not providing resultset.
>
> %28*DVeto1*%29
> %5C%28*DVeto1*%5C%29
> %22%28%22*DVeto1*%22%29%22
> %22%5C%28%22*DVeto1*%22%5C%29%22
>
>
> Thanks,
> Roopesh
>
> On Wed, Dec 6, 2017 at 7:44 AM, Emir Arnautović <
> [hidden email]> wrote:
>
>> Hi,
>> You need to escape special chars with \ and if you are sending it in URL
>> you can URL encode it, but that is URL related thing not Solr.
>>
>> Here is the list of Lucene characters that need to be escaped:
>> http://lucene.apache.org/core/7_1_0/queryparser/org/apache/
>> lucene/queryparser/classic/package-summary.html#Escaping_
>> Special_Characters <http://lucene.apache.org/core/7_1_0/queryparser/org/
>> apache/lucene/queryparser/classic/package-summary.html#
>> Escaping_Special_Characters>
>>
>> HTH,
>> Emir
>> --
>> Monitoring - Log Management - Alerting - Anomaly Detection
>> Solr & Elasticsearch Consulting Support Training - http://sematext.com/
>>
>>
>>
>>> On 6 Dec 2017, at 10:33, Roopesh Uniyal <[hidden email]>
>> wrote:
>>>
>>> Thanks Jan. It must be a late night. Not sure what I was thinking.
>>>
>>> I provided *%5C%28DVeto1%5C%29* but still not able to get the search
>> results
>>>
>>> I also have a situation where I have to search something like
>> *(ID#DVeto2)*
>>> and I am providing *%5C%28ID%23DVeto2%5C%2*9 and still not able to get
>> the
>>> resultsets.
>>>
>>> Its not throwing any error but no result found in these two scenarios.
>>> Although we know there should be some records.
>>>
>>> Am I missing anything?
>>>
>>> Thanks!
>>>
>>>
>>> On Wed, Dec 6, 2017 at 4:13 AM, <
>>> [hidden email]> wrote:
>>>
>>>> hmm ... it seems, you are using XML/HTML-encoding, but you need
>>>> HTTP-encoding, which looks like this:
>>>>
>>>>
>>>> ␣      !       "       #       $       %       &       '       (       )
>>>> *       +       ,       -       .       /       :       ;       <
>> =
>>>>>     ?       @       [       \       ]       {       |       }
>>>>
>>>> %20     %21     %22     %23     %24     %25     %26     %27     %28 %29
>>>> %2A     %2B     %2C     %2D     %2E     %2F     %3A     %3B     %3C %3D
>>>> %3E     %3F     %40     %5B     %5C     %5D     %7B     %7C     %7D
>>>>
>>>>
>>>> good luck! :)
>>>>
>>>>
>>>> Mit freundlichen Grüßen/ With kind regards
>>>>
>>>> Jan Schluchtmann
>>>> Systems Engineering Cluster Instruments
>>>> VW Group
>>>> Continental Automotive GmbH
>>>> Division Interior
>>>> ID S3 RM
>>>> VDO-Strasse 1, 64832 Babenhausen, Germany
>>>>
>>>> Telefon/Phone: +49 6073 12-4346
>>>> Telefax: +49 6073 12-79-4346
>>>>
>>>>
>>>>
>>>> Von:    Roopesh Uniyal <[hidden email]>
>>>> An:     [hidden email],
>>>> Datum:  06.12.2017 09:57
>>>> Betreff:        Issue while searching with escape characters
>>>>
>>>>
>>>>
>>>> Hello I am searching Solr 6 via http call by providing a "UserID".
>>>>
>>>> Its just that the data is in the format of (DVeto1)
>>>>
>>>> So, in my call I have to provide parenthesis but since its a special
>>>> character I need to provide escape also. Looks like its not working
>>>>
>>>> Provided the search string over http like these but none worked -
>>>>
>>>> &#40;DVeto1&#41;
>>>> &#92;&#40;DVeto1&#92;&#41;
>>>>
>>>> Since this is not working I am sure I am missing something. Will
>>>> appreciate
>>>> your inputs.
>>>>
>>>> Thanks!
>>>>
>>>>
>>>>
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: Issue while searching with escape characters

Roopesh Uniyal
Oh, that might be because I made DVeto1 in bold but it converted bold into
*. So you can ignore both *.

On Wed, Dec 6, 2017 at 10:35 AM, Emir Arnautović <
[hidden email]> wrote:

> Hi Roopesh,
> What are *? Is it wildcard or special char as well? Examples that you
> provided are  not what you said you want to search - * are not on the same
> position. If you are not finding anything, that can be due to your analysis
> - are you sure that your analysis does not trim parenthesis?
>
> Regards,
> Emir
> --
> Monitoring - Log Management - Alerting - Anomaly Detection
> Solr & Elasticsearch Consulting Support Training - http://sematext.com/
>
>
>
> > On 6 Dec 2017, at 16:13, Roopesh Uniyal <[hidden email]>
> wrote:
> >
> > Thanks Emir & Jan!
> >
> > I have a situation where I need to search a field value is
> > between parenthesis () like - *(DVeto1)*
> >
> > Based on the documentation
> > <http://lucene.apache.org/core/7_1_0/queryparser/org/
> apache/lucene/queryparser/classic/package-summary.html#
> Escaping_Special_Characters>
> > parenthesis just need escape character but no matter what way I provide
> it,
> > its not providing resultset.
> >
> > %28*DVeto1*%29
> > %5C%28*DVeto1*%5C%29
> > %22%28%22*DVeto1*%22%29%22
> > %22%5C%28%22*DVeto1*%22%5C%29%22
> >
> >
> > Thanks,
> > Roopesh
> >
> > On Wed, Dec 6, 2017 at 7:44 AM, Emir Arnautović <
> > [hidden email]> wrote:
> >
> >> Hi,
> >> You need to escape special chars with \ and if you are sending it in URL
> >> you can URL encode it, but that is URL related thing not Solr.
> >>
> >> Here is the list of Lucene characters that need to be escaped:
> >> http://lucene.apache.org/core/7_1_0/queryparser/org/apache/
> >> lucene/queryparser/classic/package-summary.html#Escaping_
> >> Special_Characters <http://lucene.apache.org/
> core/7_1_0/queryparser/org/
> >> apache/lucene/queryparser/classic/package-summary.html#
> >> Escaping_Special_Characters>
> >>
> >> HTH,
> >> Emir
> >> --
> >> Monitoring - Log Management - Alerting - Anomaly Detection
> >> Solr & Elasticsearch Consulting Support Training - http://sematext.com/
> >>
> >>
> >>
> >>> On 6 Dec 2017, at 10:33, Roopesh Uniyal <[hidden email]>
> >> wrote:
> >>>
> >>> Thanks Jan. It must be a late night. Not sure what I was thinking.
> >>>
> >>> I provided *%5C%28DVeto1%5C%29* but still not able to get the search
> >> results
> >>>
> >>> I also have a situation where I have to search something like
> >> *(ID#DVeto2)*
> >>> and I am providing *%5C%28ID%23DVeto2%5C%2*9 and still not able to get
> >> the
> >>> resultsets.
> >>>
> >>> Its not throwing any error but no result found in these two scenarios.
> >>> Although we know there should be some records.
> >>>
> >>> Am I missing anything?
> >>>
> >>> Thanks!
> >>>
> >>>
> >>> On Wed, Dec 6, 2017 at 4:13 AM, <
> >>> [hidden email]> wrote:
> >>>
> >>>> hmm ... it seems, you are using XML/HTML-encoding, but you need
> >>>> HTTP-encoding, which looks like this:
> >>>>
> >>>>
> >>>> ␣      !       "       #       $       %       &       '       (
>  )
> >>>> *       +       ,       -       .       /       :       ;       <
> >> =
> >>>>>     ?       @       [       \       ]       {       |       }
> >>>>
> >>>> %20     %21     %22     %23     %24     %25     %26     %27     %28
> %29
> >>>> %2A     %2B     %2C     %2D     %2E     %2F     %3A     %3B     %3C
> %3D
> >>>> %3E     %3F     %40     %5B     %5C     %5D     %7B     %7C     %7D
> >>>>
> >>>>
> >>>> good luck! :)
> >>>>
> >>>>
> >>>> Mit freundlichen Grüßen/ With kind regards
> >>>>
> >>>> Jan Schluchtmann
> >>>> Systems Engineering Cluster Instruments
> >>>> VW Group
> >>>> Continental Automotive GmbH
> >>>> Division Interior
> >>>> ID S3 RM
> >>>> VDO-Strasse 1, 64832 Babenhausen, Germany
> >>>>
> >>>> Telefon/Phone: +49 6073 12-4346
> >>>> Telefax: +49 6073 12-79-4346
> >>>>
> >>>>
> >>>>
> >>>> Von:    Roopesh Uniyal <[hidden email]>
> >>>> An:     [hidden email],
> >>>> Datum:  06.12.2017 09:57
> >>>> Betreff:        Issue while searching with escape characters
> >>>>
> >>>>
> >>>>
> >>>> Hello I am searching Solr 6 via http call by providing a "UserID".
> >>>>
> >>>> Its just that the data is in the format of (DVeto1)
> >>>>
> >>>> So, in my call I have to provide parenthesis but since its a special
> >>>> character I need to provide escape also. Looks like its not working
> >>>>
> >>>> Provided the search string over http like these but none worked -
> >>>>
> >>>> &#40;DVeto1&#41;
> >>>> &#92;&#40;DVeto1&#92;&#41;
> >>>>
> >>>> Since this is not working I am sure I am missing something. Will
> >>>> appreciate
> >>>> your inputs.
> >>>>
> >>>> Thanks!
> >>>>
> >>>>
> >>>>
> >>
> >>
>
>
Reply | Threaded
Open this post in threaded view
|

Antwort: Re: Issue while searching with escape characters

Jan.Christopher.Schluchtmann-EXT
In reply to this post by Roopesh Uniyal
Hi think, your first line ist correkt for the "value"-field ... what looks
your "key"-field like?
can you send the whole request, please?

something like this should work in my opinion:

(...)&key=%28DVeto1%29&(...)

Mit freundlichen Grüßen/ With kind regards

Jan Schluchtmann
Systems Engineering Cluster Instruments
VW Group
Continental Automotive GmbH
Division Interior
ID S3 RM
VDO-Strasse 1, 64832 Babenhausen, Germany

Telefon/Phone: +49 6073 12-4346
Telefax: +49 6073 12-79-4346



Von:    Roopesh Uniyal <[hidden email]>
An:     [hidden email],
Kopie:  [hidden email]
Datum:  06.12.2017 16:14
Betreff:        Re: Issue while searching with escape characters



Thanks Emir & Jan!

I have a situation where I need to search a field value is
between parenthesis () like - *(DVeto1)*

Based on the documentation
<
http://lucene.apache.org/core/7_1_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#Escaping_Special_Characters
>
parenthesis just need escape character but no matter what way I provide
it,
its not providing resultset.

%28*DVeto1*%29
%5C%28*DVeto1*%5C%29
%22%28%22*DVeto1*%22%29%22
%22%5C%28%22*DVeto1*%22%5C%29%22


Thanks,
Roopesh

On Wed, Dec 6, 2017 at 7:44 AM, Emir Arnautović <
[hidden email]> wrote:

> Hi,
> You need to escape special chars with \ and if you are sending it in URL
> you can URL encode it, but that is URL related thing not Solr.
>
> Here is the list of Lucene characters that need to be escaped:
> http://lucene.apache.org/core/7_1_0/queryparser/org/apache/
> lucene/queryparser/classic/package-summary.html#Escaping_
> Special_Characters <http://lucene.apache.org/core/7_1_0/queryparser/org/
> apache/lucene/queryparser/classic/package-summary.html#
> Escaping_Special_Characters>
>
> HTH,
> Emir
> --
> Monitoring - Log Management - Alerting - Anomaly Detection
> Solr & Elasticsearch Consulting Support Training - http://sematext.com/
>
>
>
> > On 6 Dec 2017, at 10:33, Roopesh Uniyal <[hidden email]>
> wrote:
> >
> > Thanks Jan. It must be a late night. Not sure what I was thinking.
> >
> > I provided *%5C%28DVeto1%5C%29* but still not able to get the search
> results
> >
> > I also have a situation where I have to search something like
> *(ID#DVeto2)*
> > and I am providing *%5C%28ID%23DVeto2%5C%2*9 and still not able to get
> the
> > resultsets.
> >
> > Its not throwing any error but no result found in these two scenarios.
> > Although we know there should be some records.
> >
> > Am I missing anything?
> >
> > Thanks!
> >
> >
> > On Wed, Dec 6, 2017 at 4:13 AM, <
> > [hidden email]> wrote:
> >
> >> hmm ... it seems, you are using XML/HTML-encoding, but you need
> >> HTTP-encoding, which looks like this:
> >>
> >>
> >> ␣      !       "       #       $       %       &       '       (   )
> >> *       +       ,       -       .       /       :       ;       <
>  =
> >>>      ?       @       [       \       ]       {       |       }
> >>
> >> %20     %21     %22     %23     %24     %25     %26     %27     %28
%29
> >> %2A     %2B     %2C     %2D     %2E     %2F     %3A     %3B     %3C
%3D

> >> %3E     %3F     %40     %5B     %5C     %5D     %7B     %7C     %7D
> >>
> >>
> >> good luck! :)
> >>
> >>
> >> Mit freundlichen Grüßen/ With kind regards
> >>
> >> Jan Schluchtmann
> >> Systems Engineering Cluster Instruments
> >> VW Group
> >> Continental Automotive GmbH
> >> Division Interior
> >> ID S3 RM
> >> VDO-Strasse 1, 64832 Babenhausen, Germany
> >>
> >> Telefon/Phone: +49 6073 12-4346
> >> Telefax: +49 6073 12-79-4346
> >>
> >>
> >>
> >> Von:    Roopesh Uniyal <[hidden email]>
> >> An:     [hidden email],
> >> Datum:  06.12.2017 09:57
> >> Betreff:        Issue while searching with escape characters
> >>
> >>
> >>
> >> Hello I am searching Solr 6 via http call by providing a "UserID".
> >>
> >> Its just that the data is in the format of (DVeto1)
> >>
> >> So, in my call I have to provide parenthesis but since its a special
> >> character I need to provide escape also. Looks like its not working
> >>
> >> Provided the search string over http like these but none worked -
> >>
> >> &#40;DVeto1&#41;
> >> &#92;&#40;DVeto1&#92;&#41;
> >>
> >> Since this is not working I am sure I am missing something. Will
> >> appreciate
> >> your inputs.
> >>
> >> Thanks!
> >>
> >>
> >>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Issue while searching with escape characters

Emir Arnautović
In reply to this post by Roopesh Uniyal
Hi Roopesh,
If escaping special char with \ does not result in error but in no results, then it might be worth checking if your indexing is ok - does it strip parenthesis.

Can you share example query and schema snippet where you define your field and fieldType.

Regards,
Emir
--
Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training - http://sematext.com/



> On 6 Dec 2017, at 16:39, Roopesh Uniyal <[hidden email]> wrote:
>
> Oh, that might be because I made DVeto1 in bold but it converted bold into
> *. So you can ignore both *.
>
> On Wed, Dec 6, 2017 at 10:35 AM, Emir Arnautović <
> [hidden email]> wrote:
>
>> Hi Roopesh,
>> What are *? Is it wildcard or special char as well? Examples that you
>> provided are  not what you said you want to search - * are not on the same
>> position. If you are not finding anything, that can be due to your analysis
>> - are you sure that your analysis does not trim parenthesis?
>>
>> Regards,
>> Emir
>> --
>> Monitoring - Log Management - Alerting - Anomaly Detection
>> Solr & Elasticsearch Consulting Support Training - http://sematext.com/
>>
>>
>>
>>> On 6 Dec 2017, at 16:13, Roopesh Uniyal <[hidden email]>
>> wrote:
>>>
>>> Thanks Emir & Jan!
>>>
>>> I have a situation where I need to search a field value is
>>> between parenthesis () like - *(DVeto1)*
>>>
>>> Based on the documentation
>>> <http://lucene.apache.org/core/7_1_0/queryparser/org/
>> apache/lucene/queryparser/classic/package-summary.html#
>> Escaping_Special_Characters>
>>> parenthesis just need escape character but no matter what way I provide
>> it,
>>> its not providing resultset.
>>>
>>> %28*DVeto1*%29
>>> %5C%28*DVeto1*%5C%29
>>> %22%28%22*DVeto1*%22%29%22
>>> %22%5C%28%22*DVeto1*%22%5C%29%22
>>>
>>>
>>> Thanks,
>>> Roopesh
>>>
>>> On Wed, Dec 6, 2017 at 7:44 AM, Emir Arnautović <
>>> [hidden email]> wrote:
>>>
>>>> Hi,
>>>> You need to escape special chars with \ and if you are sending it in URL
>>>> you can URL encode it, but that is URL related thing not Solr.
>>>>
>>>> Here is the list of Lucene characters that need to be escaped:
>>>> http://lucene.apache.org/core/7_1_0/queryparser/org/apache/
>>>> lucene/queryparser/classic/package-summary.html#Escaping_
>>>> Special_Characters <http://lucene.apache.org/
>> core/7_1_0/queryparser/org/
>>>> apache/lucene/queryparser/classic/package-summary.html#
>>>> Escaping_Special_Characters>
>>>>
>>>> HTH,
>>>> Emir
>>>> --
>>>> Monitoring - Log Management - Alerting - Anomaly Detection
>>>> Solr & Elasticsearch Consulting Support Training - http://sematext.com/
>>>>
>>>>
>>>>
>>>>> On 6 Dec 2017, at 10:33, Roopesh Uniyal <[hidden email]>
>>>> wrote:
>>>>>
>>>>> Thanks Jan. It must be a late night. Not sure what I was thinking.
>>>>>
>>>>> I provided *%5C%28DVeto1%5C%29* but still not able to get the search
>>>> results
>>>>>
>>>>> I also have a situation where I have to search something like
>>>> *(ID#DVeto2)*
>>>>> and I am providing *%5C%28ID%23DVeto2%5C%2*9 and still not able to get
>>>> the
>>>>> resultsets.
>>>>>
>>>>> Its not throwing any error but no result found in these two scenarios.
>>>>> Although we know there should be some records.
>>>>>
>>>>> Am I missing anything?
>>>>>
>>>>> Thanks!
>>>>>
>>>>>
>>>>> On Wed, Dec 6, 2017 at 4:13 AM, <
>>>>> [hidden email]> wrote:
>>>>>
>>>>>> hmm ... it seems, you are using XML/HTML-encoding, but you need
>>>>>> HTTP-encoding, which looks like this:
>>>>>>
>>>>>>
>>>>>> ␣      !       "       #       $       %       &       '       (
>> )
>>>>>> *       +       ,       -       .       /       :       ;       <
>>>> =
>>>>>>>    ?       @       [       \       ]       {       |       }
>>>>>>
>>>>>> %20     %21     %22     %23     %24     %25     %26     %27     %28
>> %29
>>>>>> %2A     %2B     %2C     %2D     %2E     %2F     %3A     %3B     %3C
>> %3D
>>>>>> %3E     %3F     %40     %5B     %5C     %5D     %7B     %7C     %7D
>>>>>>
>>>>>>
>>>>>> good luck! :)
>>>>>>
>>>>>>
>>>>>> Mit freundlichen Grüßen/ With kind regards
>>>>>>
>>>>>> Jan Schluchtmann
>>>>>> Systems Engineering Cluster Instruments
>>>>>> VW Group
>>>>>> Continental Automotive GmbH
>>>>>> Division Interior
>>>>>> ID S3 RM
>>>>>> VDO-Strasse 1, 64832 Babenhausen, Germany
>>>>>>
>>>>>> Telefon/Phone: +49 6073 12-4346
>>>>>> Telefax: +49 6073 12-79-4346
>>>>>>
>>>>>>
>>>>>>
>>>>>> Von:    Roopesh Uniyal <[hidden email]>
>>>>>> An:     [hidden email],
>>>>>> Datum:  06.12.2017 09:57
>>>>>> Betreff:        Issue while searching with escape characters
>>>>>>
>>>>>>
>>>>>>
>>>>>> Hello I am searching Solr 6 via http call by providing a "UserID".
>>>>>>
>>>>>> Its just that the data is in the format of (DVeto1)
>>>>>>
>>>>>> So, in my call I have to provide parenthesis but since its a special
>>>>>> character I need to provide escape also. Looks like its not working
>>>>>>
>>>>>> Provided the search string over http like these but none worked -
>>>>>>
>>>>>> &#40;DVeto1&#41;
>>>>>> &#92;&#40;DVeto1&#92;&#41;
>>>>>>
>>>>>> Since this is not working I am sure I am missing something. Will
>>>>>> appreciate
>>>>>> your inputs.
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: Issue while searching with escape characters

Roopesh Uniyal
Thanks Emir.
Got it fixed. End customer's solr was not having the records itself. They
were trying to compare apples with oranges.

On Thu, Dec 7, 2017 at 7:43 AM Emir Arnautović <[hidden email]>
wrote:

> Hi Roopesh,
> If escaping special char with \ does not result in error but in no
> results, then it might be worth checking if your indexing is ok - does it
> strip parenthesis.
>
> Can you share example query and schema snippet where you define your field
> and fieldType.
>
> Regards,
> Emir
> --
> Monitoring - Log Management - Alerting - Anomaly Detection
> Solr & Elasticsearch Consulting Support Training - http://sematext.com/
>
>
>
> > On 6 Dec 2017, at 16:39, Roopesh Uniyal <[hidden email]>
> wrote:
> >
> > Oh, that might be because I made DVeto1 in bold but it converted bold
> into
> > *. So you can ignore both *.
> >
> > On Wed, Dec 6, 2017 at 10:35 AM, Emir Arnautović <
> > [hidden email]> wrote:
> >
> >> Hi Roopesh,
> >> What are *? Is it wildcard or special char as well? Examples that you
> >> provided are  not what you said you want to search - * are not on the
> same
> >> position. If you are not finding anything, that can be due to your
> analysis
> >> - are you sure that your analysis does not trim parenthesis?
> >>
> >> Regards,
> >> Emir
> >> --
> >> Monitoring - Log Management - Alerting - Anomaly Detection
> >> Solr & Elasticsearch Consulting Support Training - http://sematext.com/
> >>
> >>
> >>
> >>> On 6 Dec 2017, at 16:13, Roopesh Uniyal <[hidden email]>
> >> wrote:
> >>>
> >>> Thanks Emir & Jan!
> >>>
> >>> I have a situation where I need to search a field value is
> >>> between parenthesis () like - *(DVeto1)*
> >>>
> >>> Based on the documentation
> >>> <http://lucene.apache.org/core/7_1_0/queryparser/org/
> >> apache/lucene/queryparser/classic/package-summary.html#
> >> Escaping_Special_Characters>
> >>> parenthesis just need escape character but no matter what way I provide
> >> it,
> >>> its not providing resultset.
> >>>
> >>> %28*DVeto1*%29
> >>> %5C%28*DVeto1*%5C%29
> >>> %22%28%22*DVeto1*%22%29%22
> >>> %22%5C%28%22*DVeto1*%22%5C%29%22
> >>>
> >>>
> >>> Thanks,
> >>> Roopesh
> >>>
> >>> On Wed, Dec 6, 2017 at 7:44 AM, Emir Arnautović <
> >>> [hidden email]> wrote:
> >>>
> >>>> Hi,
> >>>> You need to escape special chars with \ and if you are sending it in
> URL
> >>>> you can URL encode it, but that is URL related thing not Solr.
> >>>>
> >>>> Here is the list of Lucene characters that need to be escaped:
> >>>> http://lucene.apache.org/core/7_1_0/queryparser/org/apache/
> >>>> lucene/queryparser/classic/package-summary.html#Escaping_
> >>>> Special_Characters <http://lucene.apache.org/
> >> core/7_1_0/queryparser/org/
> >>>> apache/lucene/queryparser/classic/package-summary.html#
> >>>> Escaping_Special_Characters>
> >>>>
> >>>> HTH,
> >>>> Emir
> >>>> --
> >>>> Monitoring - Log Management - Alerting - Anomaly Detection
> >>>> Solr & Elasticsearch Consulting Support Training -
> http://sematext.com/
> >>>>
> >>>>
> >>>>
> >>>>> On 6 Dec 2017, at 10:33, Roopesh Uniyal <[hidden email]>
> >>>> wrote:
> >>>>>
> >>>>> Thanks Jan. It must be a late night. Not sure what I was thinking.
> >>>>>
> >>>>> I provided *%5C%28DVeto1%5C%29* but still not able to get the search
> >>>> results
> >>>>>
> >>>>> I also have a situation where I have to search something like
> >>>> *(ID#DVeto2)*
> >>>>> and I am providing *%5C%28ID%23DVeto2%5C%2*9 and still not able to
> get
> >>>> the
> >>>>> resultsets.
> >>>>>
> >>>>> Its not throwing any error but no result found in these two
> scenarios.
> >>>>> Although we know there should be some records.
> >>>>>
> >>>>> Am I missing anything?
> >>>>>
> >>>>> Thanks!
> >>>>>
> >>>>>
> >>>>> On Wed, Dec 6, 2017 at 4:13 AM, <
> >>>>> [hidden email]> wrote:
> >>>>>
> >>>>>> hmm ... it seems, you are using XML/HTML-encoding, but you need
> >>>>>> HTTP-encoding, which looks like this:
> >>>>>>
> >>>>>>
> >>>>>> ␣      !       "       #       $       %       &       '       (
> >> )
> >>>>>> *       +       ,       -       .       /       :       ;       <
> >>>> =
> >>>>>>>    ?       @       [       \       ]       {       |       }
> >>>>>>
> >>>>>> %20     %21     %22     %23     %24     %25     %26     %27     %28
> >> %29
> >>>>>> %2A     %2B     %2C     %2D     %2E     %2F     %3A     %3B     %3C
> >> %3D
> >>>>>> %3E     %3F     %40     %5B     %5C     %5D     %7B     %7C     %7D
> >>>>>>
> >>>>>>
> >>>>>> good luck! :)
> >>>>>>
> >>>>>>
> >>>>>> Mit freundlichen Grüßen/ With kind regards
> >>>>>>
> >>>>>> Jan Schluchtmann
> >>>>>> Systems Engineering Cluster Instruments
> >>>>>> VW Group
> >>>>>> Continental Automotive GmbH
> >>>>>> Division Interior
> >>>>>> ID S3 RM
> >>>>>> VDO-Strasse 1, 64832 Babenhausen, Germany
> >>>>>>
> >>>>>> Telefon/Phone: +49 6073 12-4346
> >>>>>> Telefax: +49 6073 12-79-4346
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> Von:    Roopesh Uniyal <[hidden email]>
> >>>>>> An:     [hidden email],
> >>>>>> Datum:  06.12.2017 09:57
> >>>>>> Betreff:        Issue while searching with escape characters
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> Hello I am searching Solr 6 via http call by providing a "UserID".
> >>>>>>
> >>>>>> Its just that the data is in the format of (DVeto1)
> >>>>>>
> >>>>>> So, in my call I have to provide parenthesis but since its a special
> >>>>>> character I need to provide escape also. Looks like its not working
> >>>>>>
> >>>>>> Provided the search string over http like these but none worked -
> >>>>>>
> >>>>>> &#40;DVeto1&#41;
> >>>>>> &#92;&#40;DVeto1&#92;&#41;
> >>>>>>
> >>>>>> Since this is not working I am sure I am missing something. Will
> >>>>>> appreciate
> >>>>>> your inputs.
> >>>>>>
> >>>>>> Thanks!
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>
> >>>>
> >>
> >>
>
>