solr wild card search

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

solr wild card search

Anil-2
Hi Team,

Good Morning.

I am storing url in string field. wild card search is giving following
error.

"error":{

    "metadata":[

      "error-class","org.apache.solr.common.SolrException",

      "root-error-class","org.apache.solr.parser.ParseException"],

    "msg":"org.apache.solr.search.SyntaxError: Cannot parse 'url:
https://facebook.com/posts/123456': Encountered \" \":\" \": \"\" at line
1, column 15.\nWas expecting one of:\n    <EOF> \n    <AND> ...\n    <OR>
...\n    <NOT> ...\n    \"+\" ...\n    \"-\" ...\n    <BAREOPER> ...\n
\"(\" ...\n    \"*\" ...\n    \"^\" ...\n    <QUOTED> ...\n    <TERM>
...\n    <FUZZY_SLOP> ...\n    <PREFIXTERM> ...\n    <WILDTERM> ...\n
<REGEXPTERM> ...\n    \"[\" ...\n    \"{\" ...\n    <LPARAMS> ...\n
\"filter(\" ...\n    <NUMBER> ...\n    ",

    "code":400}}


only exact match on url field is working.


Thanks,

Anil
Reply | Threaded
Open this post in threaded view
|

Re: solr wild card search

Erick Erickson
Show us the exact search you’re using, both the failure and success case please. Most likely you need to escape things like the colon…

Best,
Erick

> On Apr 8, 2019, at 8:19 AM, Anil <[hidden email]> wrote:
>
> Hi Team,
>
> Good Morning.
>
> I am storing url in string field. wild card search is giving following
> error.
>
> "error":{
>
>    "metadata":[
>
>      "error-class","org.apache.solr.common.SolrException",
>
>      "root-error-class","org.apache.solr.parser.ParseException"],
>
>    "msg":"org.apache.solr.search.SyntaxError: Cannot parse 'url:
> https://facebook.com/posts/123456': Encountered \" \":\" \": \"\" at line
> 1, column 15.\nWas expecting one of:\n    <EOF> \n    <AND> ...\n    <OR>
> ...\n    <NOT> ...\n    \"+\" ...\n    \"-\" ...\n    <BAREOPER> ...\n
> \"(\" ...\n    \"*\" ...\n    \"^\" ...\n    <QUOTED> ...\n    <TERM>
> ...\n    <FUZZY_SLOP> ...\n    <PREFIXTERM> ...\n    <WILDTERM> ...\n
> <REGEXPTERM> ...\n    \"[\" ...\n    \"{\" ...\n    <LPARAMS> ...\n
> \"filter(\" ...\n    <NUMBER> ...\n    ",
>
>    "code":400}}
>
>
> only exact match on url field is working.
>
>
> Thanks,
>
> Anil

Reply | Threaded
Open this post in threaded view
|

Re: solr wild card search

Anil-2
Hi Eric,

url:"https://facebook.com/posts/123456" is working.
url:https://facebook.com/posts <https://facebook.com/posts/123456>* is not
working.

i tried to escape forward slash  and dot (.).. didnt help. i missed colon.
let me try. Thanks.

Regards,
Anil

On Mon, 8 Apr 2019 at 21:02, Erick Erickson <[hidden email]> wrote:

> Show us the exact search you’re using, both the failure and success case
> please. Most likely you need to escape things like the colon…
>
> Best,
> Erick
>
> > On Apr 8, 2019, at 8:19 AM, Anil <[hidden email]> wrote:
> >
> > Hi Team,
> >
> > Good Morning.
> >
> > I am storing url in string field. wild card search is giving following
> > error.
> >
> > "error":{
> >
> >    "metadata":[
> >
> >      "error-class","org.apache.solr.common.SolrException",
> >
> >      "root-error-class","org.apache.solr.parser.ParseException"],
> >
> >    "msg":"org.apache.solr.search.SyntaxError: Cannot parse 'url:
> > https://facebook.com/posts/123456': Encountered \" \":\" \": \"\" at
> line
> > 1, column 15.\nWas expecting one of:\n    <EOF> \n    <AND> ...\n    <OR>
> > ...\n    <NOT> ...\n    \"+\" ...\n    \"-\" ...\n    <BAREOPER> ...\n
> > \"(\" ...\n    \"*\" ...\n    \"^\" ...\n    <QUOTED> ...\n    <TERM>
> > ...\n    <FUZZY_SLOP> ...\n    <PREFIXTERM> ...\n    <WILDTERM> ...\n
> > <REGEXPTERM> ...\n    \"[\" ...\n    \"{\" ...\n    <LPARAMS> ...\n
> > \"filter(\" ...\n    <NUMBER> ...\n    ",
> >
> >    "code":400}}
> >
> >
> > only exact match on url field is working.
> >
> >
> > Thanks,
> >
> > Anil
>
>
Reply | Threaded
Open this post in threaded view
|

Re: solr wild card search

Erick Erickson
See: https://lucene.apache.org/solr/guide/6_6/the-standard-query-parser.html

> On Apr 8, 2019, at 9:04 AM, Anil <[hidden email]> wrote:
>
> Hi Eric,
>
> url:"https://facebook.com/posts/123456" is working.
> url:https://facebook.com/posts <https://facebook.com/posts/123456>* is not
> working.
>
> i tried to escape forward slash  and dot (.).. didnt help. i missed colon.
> let me try. Thanks.
>
> Regards,
> Anil
>
> On Mon, 8 Apr 2019 at 21:02, Erick Erickson <[hidden email]> wrote:
>
>> Show us the exact search you’re using, both the failure and success case
>> please. Most likely you need to escape things like the colon…
>>
>> Best,
>> Erick
>>
>>> On Apr 8, 2019, at 8:19 AM, Anil <[hidden email]> wrote:
>>>
>>> Hi Team,
>>>
>>> Good Morning.
>>>
>>> I am storing url in string field. wild card search is giving following
>>> error.
>>>
>>> "error":{
>>>
>>>   "metadata":[
>>>
>>>     "error-class","org.apache.solr.common.SolrException",
>>>
>>>     "root-error-class","org.apache.solr.parser.ParseException"],
>>>
>>>   "msg":"org.apache.solr.search.SyntaxError: Cannot parse 'url:
>>> https://facebook.com/posts/123456': Encountered \" \":\" \": \"\" at
>> line
>>> 1, column 15.\nWas expecting one of:\n    <EOF> \n    <AND> ...\n    <OR>
>>> ...\n    <NOT> ...\n    \"+\" ...\n    \"-\" ...\n    <BAREOPER> ...\n
>>> \"(\" ...\n    \"*\" ...\n    \"^\" ...\n    <QUOTED> ...\n    <TERM>
>>> ...\n    <FUZZY_SLOP> ...\n    <PREFIXTERM> ...\n    <WILDTERM> ...\n
>>> <REGEXPTERM> ...\n    \"[\" ...\n    \"{\" ...\n    <LPARAMS> ...\n
>>> \"filter(\" ...\n    <NUMBER> ...\n    ",
>>>
>>>   "code":400}}
>>>
>>>
>>> only exact match on url field is working.
>>>
>>>
>>> Thanks,
>>>
>>> Anil
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: solr wild card search

Anil-2
Thanks Eric. escaped colon and it worked. my bad.. i missed it :)

On Mon, 8 Apr 2019 at 21:55, Erick Erickson <[hidden email]> wrote:

> See:
> https://lucene.apache.org/solr/guide/6_6/the-standard-query-parser.html
>
> > On Apr 8, 2019, at 9:04 AM, Anil <[hidden email]> wrote:
> >
> > Hi Eric,
> >
> > url:"https://facebook.com/posts/123456" is working.
> > url:https://facebook.com/posts <https://facebook.com/posts/123456>* is
> not
> > working.
> >
> > i tried to escape forward slash  and dot (.).. didnt help. i missed
> colon.
> > let me try. Thanks.
> >
> > Regards,
> > Anil
> >
> > On Mon, 8 Apr 2019 at 21:02, Erick Erickson <[hidden email]>
> wrote:
> >
> >> Show us the exact search you’re using, both the failure and success case
> >> please. Most likely you need to escape things like the colon…
> >>
> >> Best,
> >> Erick
> >>
> >>> On Apr 8, 2019, at 8:19 AM, Anil <[hidden email]> wrote:
> >>>
> >>> Hi Team,
> >>>
> >>> Good Morning.
> >>>
> >>> I am storing url in string field. wild card search is giving following
> >>> error.
> >>>
> >>> "error":{
> >>>
> >>>   "metadata":[
> >>>
> >>>     "error-class","org.apache.solr.common.SolrException",
> >>>
> >>>     "root-error-class","org.apache.solr.parser.ParseException"],
> >>>
> >>>   "msg":"org.apache.solr.search.SyntaxError: Cannot parse 'url:
> >>> https://facebook.com/posts/123456': Encountered \" \":\" \": \"\" at
> >> line
> >>> 1, column 15.\nWas expecting one of:\n    <EOF> \n    <AND> ...\n
> <OR>
> >>> ...\n    <NOT> ...\n    \"+\" ...\n    \"-\" ...\n    <BAREOPER> ...\n
> >>> \"(\" ...\n    \"*\" ...\n    \"^\" ...\n    <QUOTED> ...\n    <TERM>
> >>> ...\n    <FUZZY_SLOP> ...\n    <PREFIXTERM> ...\n    <WILDTERM> ...\n
> >>> <REGEXPTERM> ...\n    \"[\" ...\n    \"{\" ...\n    <LPARAMS> ...\n
> >>> \"filter(\" ...\n    <NUMBER> ...\n    ",
> >>>
> >>>   "code":400}}
> >>>
> >>>
> >>> only exact match on url field is working.
> >>>
> >>>
> >>> Thanks,
> >>>
> >>> Anil
> >>
> >>
>
>