query syntax

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

query syntax

Sergey Polzunov-2
Hi

         I have in index document with field "name" and its value is
"somename123"
         Why I can't find anything with query
             name:somename123*
         but there are results on query
             name:"somename123*"
         As far as I understand first query is just fine. why Solr
didn't understand it?

         I'm using StandardRequestHandler

thank you

--
Best regards,
Traut
Reply | Threaded
Open this post in threaded view
|

Re: query syntax

Yonik Seeley-2
On 11/6/07, Traut <[hidden email]> wrote:
>          I have in index document with field "name" and its value is
> "somename123"
>          Why I can't find anything with query
>              name:somename123*

This is a prefix query.  No analysis is done on the prefix, so it may
not match analysis that was done when the document was indexed.

For example, if you use WordDelimiterFilter, this may be indexed as
"somename 123"

>          but there are results on query
>              name:"somename123*"

This is not a prefix query.  The * will most likely be removed by the
analyzer, leaving you effectively with a query of name:somename123

-Yonik
Reply | Threaded
Open this post in threaded view
|

Re: query syntax

Sergey Polzunov-2
So you think my problem is caused by different index/query data
analysis? i'll check it. thank you

On Nov 6, 2007 6:02 PM, Yonik Seeley <[hidden email]> wrote:

> On 11/6/07, Traut <[hidden email]> wrote:
> >          I have in index document with field "name" and its value is
> > "somename123"
> >          Why I can't find anything with query
> >              name:somename123*
>
> This is a prefix query.  No analysis is done on the prefix, so it may
> not match analysis that was done when the document was indexed.
>
> For example, if you use WordDelimiterFilter, this may be indexed as
> "somename 123"
>
> >          but there are results on query
> >              name:"somename123*"
>
> This is not a prefix query.  The * will most likely be removed by the
> analyzer, leaving you effectively with a query of name:somename123
>
> -Yonik
>



--
Best regards,
Traut