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 ahammad <ah...@gmail.com> on 2009/05/28 21:07:22 UTC
Question about field types and querying
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.
Re: Question about field types and querying
Posted by Jay Hill <ja...@gmail.com>.
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 <ah...@gmail.com> 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.
>
>
Re: Question about field types and querying
Posted by Avlesh Singh <av...@gmail.com>.
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 <ah...@gmail.com> 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.
>
>