Question about field types and querying

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

Question about field types and querying

ahammad
Hello,

I have a field type of "text" in my collection called "question".

When I query for the word "customer" for example in the "question" field (ie q=question:customer), the first document with the highest score shows up, but does not contain the word customer at all.

Instead, it contains the word "customize".

What would be a way around this? I tried changing the type to string instead of text, but that I wouldn't get any results if I don't have the exact statement in there...
Reply | Threaded
Open this post in threaded view
|

Re: Question about field types and querying

Jay Hill
Try using the admin analysis tool
(http://<host>:<port>/solr/admin/analysis.jsp)
too see what the analysis chain is doing to your query. Enter the field name
("question" in your case) and the Field value (Index) "customize" (since
that's what's in the document). For Field value (Query) enter "customer".
Check "Verbose Output" and click "Analyze". This will show you each filter
in the chain and the actions they are taking on your query. Note that the
highlighted fields show where a match would occur.

Then adjust your fieldTypes and fields to get the results you want. Create a
new fieldType if needed and add/remove filters as needed.

-Jay


On Thu, May 28, 2009 at 12:07 PM, ahammad <[hidden email]> wrote:

>
> Hello,
>
> I have a field type of "text" in my collection called "question".
>
> When I query for the word "customer" for example in the "question" field
> (ie
> q=question:customer), the first document with the highest score shows up,
> but does not contain the word customer at all.
>
> Instead, it contains the word "customize".
>
> What would be a way around this? I tried changing the type to string
> instead
> of text, but that I wouldn't get any results if I don't have the exact
> statement in there...
> --
> View this message in context:
> http://www.nabble.com/Question-about-field-types-and-querying-tp23768061p23768061.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Question about field types and querying

Avlesh Singh
In reply to this post by ahammad
Check if your text field definition in schema.xml has a EdgeNGramFilter
applied to it.

Cheers
Avlesh

On Fri, May 29, 2009 at 12:37 AM, ahammad <[hidden email]> wrote:

>
> Hello,
>
> I have a field type of "text" in my collection called "question".
>
> When I query for the word "customer" for example in the "question" field
> (ie
> q=question:customer), the first document with the highest score shows up,
> but does not contain the word customer at all.
>
> Instead, it contains the word "customize".
>
> What would be a way around this? I tried changing the type to string
> instead
> of text, but that I wouldn't get any results if I don't have the exact
> statement in there...
> --
> View this message in context:
> http://www.nabble.com/Question-about-field-types-and-querying-tp23768061p23768061.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>