lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Avlesh Singh <avl...@gmail.com>
Subject Re: weird problem with letters S and T
Date Thu, 29 Oct 2009 01:26:36 GMT
>
> Any ideas, are S and T special chars in query for solr?
>
Nope, they are NOT. My guess is that

   - You are using a "text" type field for firstLetterTitle which has the
   stopword filter applied to it.
   - Your "stopwords.txt" file contains the characters "s" and "t" because
   of which the above mentioned filter "eats" them up while indexing and
   searching.

If the above assumptions are correct, then there are two ways to fix it -

   - Remove the characters "s" and "t" from your stopwords.txt file and do a
   re-index. Searches should work fine after that.
   - For this particular use-case, you can keep your firstLetterTitle field
   as a "string" type untokenized field. You will not have to worry about
   stopwords in that case.

Cheers
Avlesh

On Thu, Oct 29, 2009 at 3:47 AM, Joel Nylund <jnylund@yahoo.com> wrote:

> (I am super new to solr, sorry if this is an easy one)
>
> Hi, I want to support an A-Z type view of my data.
>
> I have a DataImportHandler that uses sql (my query is complex, but the part
> that matters is:
>
> SELECT f.id, f.title, LEFT(f.title,1) as firstLetterTitle FROM Foo f
>
> I can create this index with no issues.
>
> I can query the title with no problem:
>
> http://localhost:8983/solr/select?q=title:super
>
> I can query the first letters mostly with no problem:
>
> http://localhost:8983/solr/select?q=firstLetterTitle:a
>
> Returns all the foo's with the first letter a.
>
> This actually works with every letter except S and T
>
> If I query those, I get no results. The weird thing if I do the title query
> above with "Super" I get lots of results, and the xml shoes the
> firstLetterTitles for those to be "S"
>
> <doc>
> <str name="firstLetterTitle">S</str>
> <str name="id">84861348</str>
> <str name="title">Super Cool</str>
> </doc>
> -
> <doc>
> <str name="firstLetterTitle">S</str>
> <str name="id">108692</str>
> <str name="title">Super 45</str>
> </doc>
> -
> <doc>
>
> etc.
>
> Any ideas, are S and T special chars in query for solr?
>
> here is the response from the s query with debug = true
>
> <response>
> -
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">24</int>
> -
> <lst name="params">
> <str name="q">firstLetterTitle:s</str>
> <str name="debugQuery">true</str>
> </lst>
> </lst>
> <result name="response" numFound="0" start="0"/>
> -
> <lst name="debug">
> <str name="rawquerystring">firstLetterTitle:s</str>
> <str name="querystring">firstLetterTitle:s</str>
> <str name="parsedquery"/>
> <str name="parsedquery_toString"/>
> <lst name="explain"/>
> <str name="QParser">OldLuceneQParser</str>
> -
> <lst name="timing">
> <double name="time">2.0</double>
> -
> <lst name="prepare">
> <double name="time">1.0</double>
> -
> <lst name="org.apache.solr.handler.component.QueryComponent">
> <double name="time">1.0</double>
> </lst>
> -
> <lst name="org.apache.solr.handler.component.FacetComponent">
> <double name="time">0.0</double>
> </lst>
> -
> <lst name="org.apache.solr.handler.component.MoreLikeThisComponent">
> <double name="time">0.0</double>
> </lst>
> -
> <lst name="org.apache.solr.handler.component.HighlightComponent">
> <double name="time">0.0</double>
> </lst>
> -
> <lst name="org.apache.solr.handler.component.DebugComponent">
> <double name="time">0.0</double>
> </lst>
> </lst>
> -
> <lst name="process">
> <double name="time">0.0</double>
> -
> <lst name="org.apache.solr.handler.component.QueryComponent">
> <double name="time">0.0</double>
> </lst>
> -
> <lst name="org.apache.solr.handler.component.FacetComponent">
> <double name="time">0.0</double>
> </lst>
> -
> <lst name="org.apache.solr.handler.component.MoreLikeThisComponent">
> <double name="time">0.0</double>
> </lst>
> -
> <lst name="org.apache.solr.handler.component.HighlightComponent">
> <double name="time">0.0</double>
> </lst>
> -
> <lst name="org.apache.solr.handler.component.DebugComponent">
> <double name="time">0.0</double>
> </lst>
> </lst>
> </lst>
> </lst>
> </response>
>
>
>
> thanks
> Joel
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message