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 Jibo John <ji...@mac.com> on 2009/12/16 23:10:40 UTC

parsedquery becomes PhraseQuery

Hello,

I have a question on how solr determines whether the q value needs to be analyzed as a regular query or as a phrase query.

Let's say, I have a text    'jibojohn info disk/1.0'

If I query for 'jibojohn info', I get the results. The query is parsed as:

 <str name="rawquerystring">jibojohn info</str>
 <str name="querystring">jibojohn info</str>
 <str name="parsedquery">+data:jibojohn +data:info</str>
 <str name="parsedquery_toString">+data:jibojohn +data:info</str>

However, if I query for 'disk/1.0', I get nothing. The query is parsed as:

<str name="rawquerystring">disk/1.0</str>
 <str name="querystring">disk/1.0</str>
 <str name="parsedquery">PhraseQuery(data:"disk 1 0")</str>
 <str name="parsedquery_toString">data:"disk 1 0"</str>

I was expecting this to be treated as a regular query, instead of a phrase query.  I was wondering why.

Appreciate your input.

-Jibo





Re: parsedquery becomes PhraseQuery

Posted by Raghuveer Kancherla <ra...@aplopio.com>.
Its likely that your analyzer has WordDelimiterFilterFactory (look at your
schema for the field in question).
If a single token is split into more tokens during the analysis phase, solr
will do a phrase query instead of a term query.

In your case disk/1.0 is being analyzed into disk 1 0 (three tokens). Hence
the phrase query.

-Raghu

On Thu, Dec 17, 2009 at 3:40 AM, Jibo John <ji...@mac.com> wrote:

> Hello,
>
> I have a question on how solr determines whether the q value needs to be
> analyzed as a regular query or as a phrase query.
>
> Let's say, I have a text    'jibojohn info disk/1.0'
>
> If I query for 'jibojohn info', I get the results. The query is parsed as:
>
>  <str name="rawquerystring">jibojohn info</str>
>  <str name="querystring">jibojohn info</str>
>  <str name="parsedquery">+data:jibojohn +data:info</str>
>  <str name="parsedquery_toString">+data:jibojohn +data:info</str>
>
> However, if I query for 'disk/1.0', I get nothing. The query is parsed as:
>
> <str name="rawquerystring">disk/1.0</str>
>  <str name="querystring">disk/1.0</str>
>  <str name="parsedquery">PhraseQuery(data:"disk 1 0")</str>
>  <str name="parsedquery_toString">data:"disk 1 0"</str>
>
> I was expecting this to be treated as a regular query, instead of a phrase
> query.  I was wondering why.
>
> Appreciate your input.
>
> -Jibo
>
>
>
>
>