You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Alessandro Benedetti <be...@gmail.com> on 2015/11/24 17:31:11 UTC
[Edismax] * escaping
Hi guys,
I was wondering how can I escape the '*' character to explicitly look for
it instead of using it as a wildcard.
I was trying escaping :
*Edismax*
*q*= a\*b
which resulted in :
*rawquerystring*": "a\\*b",
"*querystring*": "a\\*b",
"*parsedquery*": "BoostedQuery(boost(+((area:a area:b) |
((country:a country:b)^5.0) |
((resort:a resort:b)^15.0) |
((region:a region:b)^10.0)),
sum(const(1),product(const(1),int(popularity)))))",
It seems *edismax* is converting the * to a space that causes a disjunction.
*Dismax* is behaving exactly the same.
*rawquerystring"*: "a\\*b",
"*querystring*": "a\\*b",
"*parsedquery*": "(+DisjunctionMaxQuery(((area:a area:b) | ((country:a
country:b)^5.0) | ((*resort:a* resort:b)^15.0) | ((region:a
region:b)^10.0))) ())/no_coord",
"parsedquery_toString": "+((area:a area:b) | ((country:a country:b)^5.0) |
((resort:a resort:b)^15.0) | ((region:a region:b)^10.0)) ()",
I think i am missing something really simple ...
Cheers
--
--------------------------
Benedetti Alessandro
Visiting card - http://about.me/alessandro_benedetti
Blog - http://alexbenedetti.blogspot.co.uk
"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"
William Blake - Songs of Experience -1794 England
Re: [Edismax] * escaping
Posted by Jack Krupansky <ja...@gmail.com>.
Yeah, this stuff is poorly documented, not very intuitive, and the
terminology is poorly designed in the first place, so it's completely
expected to easily get confused by it. Not even a mention of it in the Solr
reference guide.
-- Jack Krupansky
On Wed, Nov 25, 2015 at 4:39 AM, Alessandro Benedetti <abenedetti@apache.org
> wrote:
> Hi Shawn,
> thank you very much!
> I was thinking the debug "parsed query" was showing the "post parsing, pre
> analysis" queries.
> But actually it shows the post analysis.
>
> Cheers
>
>
> On 24 November 2015 at 17:49, Shawn Heisey <ap...@elyograg.org> wrote:
>
> > On 11/24/2015 9:31 AM, Alessandro Benedetti wrote:
> > > I was wondering how can I escape the '*' character to explicitly look
> for
> > > it instead of using it as a wildcard.
> >
> > <snip>
> >
> > > *rawquerystring*": "a\\*b",
> > > "*querystring*": "a\\*b",
> > > "*parsedquery*": "BoostedQuery(boost(+((area:a area:b) |
> > > ((country:a country:b)^5.0) |
> > > ((resort:a resort:b)^15.0) |
> > > ((region:a region:b)^10.0)),
> > > sum(const(1),product(const(1),int(popularity)))))",
> > >
> > >
> > > It seems *edismax* is converting the * to a space that causes a
> > disjunction.
> >
> > It is not edismax that is changing the asterisk. It is the query
> > analysis on the fields named area, country, resort, and region.
> > Escaping the character prevented the query parser from treating it as a
> > wildcard, so it was passed on to the query analyzer, which likely
> > includes a tokenizer or filter that splits tokens on punctuation.
> >
> > Thanks,
> > Shawn
> >
> >
>
>
> --
> --------------------------
>
> Benedetti Alessandro
> Visiting card : http://about.me/alessandro_benedetti
>
> "Tyger, tyger burning bright
> In the forests of the night,
> What immortal hand or eye
> Could frame thy fearful symmetry?"
>
> William Blake - Songs of Experience -1794 England
>
Re: [Edismax] * escaping
Posted by Alessandro Benedetti <ab...@apache.org>.
Hi Shawn,
thank you very much!
I was thinking the debug "parsed query" was showing the "post parsing, pre
analysis" queries.
But actually it shows the post analysis.
Cheers
On 24 November 2015 at 17:49, Shawn Heisey <ap...@elyograg.org> wrote:
> On 11/24/2015 9:31 AM, Alessandro Benedetti wrote:
> > I was wondering how can I escape the '*' character to explicitly look for
> > it instead of using it as a wildcard.
>
> <snip>
>
> > *rawquerystring*": "a\\*b",
> > "*querystring*": "a\\*b",
> > "*parsedquery*": "BoostedQuery(boost(+((area:a area:b) |
> > ((country:a country:b)^5.0) |
> > ((resort:a resort:b)^15.0) |
> > ((region:a region:b)^10.0)),
> > sum(const(1),product(const(1),int(popularity)))))",
> >
> >
> > It seems *edismax* is converting the * to a space that causes a
> disjunction.
>
> It is not edismax that is changing the asterisk. It is the query
> analysis on the fields named area, country, resort, and region.
> Escaping the character prevented the query parser from treating it as a
> wildcard, so it was passed on to the query analyzer, which likely
> includes a tokenizer or filter that splits tokens on punctuation.
>
> Thanks,
> Shawn
>
>
--
--------------------------
Benedetti Alessandro
Visiting card : http://about.me/alessandro_benedetti
"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"
William Blake - Songs of Experience -1794 England
Re: [Edismax] * escaping
Posted by Shawn Heisey <ap...@elyograg.org>.
On 11/24/2015 9:31 AM, Alessandro Benedetti wrote:
> I was wondering how can I escape the '*' character to explicitly look for
> it instead of using it as a wildcard.
<snip>
> *rawquerystring*": "a\\*b",
> "*querystring*": "a\\*b",
> "*parsedquery*": "BoostedQuery(boost(+((area:a area:b) |
> ((country:a country:b)^5.0) |
> ((resort:a resort:b)^15.0) |
> ((region:a region:b)^10.0)),
> sum(const(1),product(const(1),int(popularity)))))",
>
>
> It seems *edismax* is converting the * to a space that causes a disjunction.
It is not edismax that is changing the asterisk. It is the query
analysis on the fields named area, country, resort, and region.
Escaping the character prevented the query parser from treating it as a
wildcard, so it was passed on to the query analyzer, which likely
includes a tokenizer or filter that splits tokens on punctuation.
Thanks,
Shawn