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 Varun Thacker <va...@gmail.com> on 2012/11/22 12:08:14 UTC

How to use eDismax query parser on a non tokenized field

I have indexed documents using a fieldType which does not break the word
up. I confirmed this by looking up the index in luke. I can see that the
words haven't been tokenized.

I use a search handler which uses edismax query parser for searching.
According to the wiki also
http://wiki.apache.org/solr/ExtendedDisMax#Query_Structure Extended DisMax
breaks up the query string into words before searching. Thus no results
show up.

Example for q=foo bar:
In the index : fieldNonTokenized:foo bar

And when searching this is the final query getting made
is: ((fieldNonTokenized:foo:foo)~0.01 (fieldNonTokenized:foo:bar)~0.01)~1

Thus no document matches and returns no result. I can understand why this
is happening. Is there any way where I can say that the query string should
not be broken up into words?

-- 


Regards,
Varun Thacker
http://www.vthacker.in/

Re: How to use eDismax query parser on a non tokenized field

Posted by Varun Thacker <va...@gmail.com>.
Thanks . That did the trick. Initially I did try putting the entire query
in quotes but that didn't work.

On Thu, Nov 22, 2012 at 4:42 PM, Tomás Fernández Löbbe <
tomasflobbe@gmail.com> wrote:

> ...or...
>



-- 


Regards,
Varun Thacker
http://www.vthacker.in/

Re: How to use eDismax query parser on a non tokenized field

Posted by Tomás Fernández Löbbe <to...@gmail.com>.
You can either escape the whitespace with "\" or search as a phrase.

fieldNonTokenized:foo\ bar
...or...
fieldNonTokenized:"foo bar"


On Thu, Nov 22, 2012 at 9:08 AM, Varun Thacker
<va...@gmail.com>wrote:

> I have indexed documents using a fieldType which does not break the word
> up. I confirmed this by looking up the index in luke. I can see that the
> words haven't been tokenized.
>
> I use a search handler which uses edismax query parser for searching.
> According to the wiki also
> http://wiki.apache.org/solr/ExtendedDisMax#Query_Structure Extended DisMax
> breaks up the query string into words before searching. Thus no results
> show up.
>
> Example for q=foo bar:
> In the index : fieldNonTokenized:foo bar
>
> And when searching this is the final query getting made
> is: ((fieldNonTokenized:foo:foo)~0.01 (fieldNonTokenized:foo:bar)~0.01)~1
>
> Thus no document matches and returns no result. I can understand why this
> is happening. Is there any way where I can say that the query string should
> not be broken up into words?
>
> --
>
>
> Regards,
> Varun Thacker
> http://www.vthacker.in/
>