Field tokenizer question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Field tokenizer question

Ashish P
This post was updated on .
I have created a field,
<fieldtype name="conditionText" class="solr.StrField" >
                        <analyzer>
                <tokenizer class="solr.PatternTokenizerFactory" pattern="_" />
                        </analyzer>
        </fieldtype>

The pattern is "_" (Underscore)

When I do field analysis using solr admin, it shows it correctly. Have a look at attached image. e.g. cric_info



But when I search the field, like searchbam:cric, it returns zero results.

I am expecting that I should be able to search on cric and info both individually.

But the response is :
<response>
- <lst name="responseHeader">
  <int name="status">0</int> 
  <int name="QTime">47</int> 
- <lst name="params">
  <str name="indent">on</str> 
  <str name="start">0</str> 
  <str name="q">searchbam:cric</str> 
  <str name="rows">10</str> 
  <str name="version">2.2</str> 
  </lst>
  </lst>
  <result name="response" numFound="0" start="0" /> 
  </response>

And even following...
<response>
- <lst name="responseHeader">
  <int name="status">0</int> 
  <int name="QTime">47</int> 
- <lst name="params">
  <str name="indent">on</str> 
  <str name="start">0</str> 
  <str name="q">searchbam:cric_info</str> 
  <str name="rows">10</str> 
  <str name="version">2.2</str> 
  </lst>
  </lst>
  <result name="response" numFound="0" start="0" /> 
  </response>
The index is properly committed.

Am I missing something here?????



Reply | Threaded
Open this post in threaded view
|

Re: Field tokenizer question

Koji Sekiguchi
Ashish P wrote:
> I have created a field,
> <fieldtype name="conditionText" class="solr.StrField" >
> <analyzer>
>        <tokenizer class="solr.PatternTokenizerFactory" pattern="_" />
> </analyzer>
>         </fieldtype>
>
>  
Set class="solr.TextField" instead of class="solr.StrField" in your
fieldType definition.
Then reindex and commit.

Koji

Reply | Threaded
Open this post in threaded view
|

Re: Field tokenizer question

Ashish P
Hey it works. Can you please tell me the reason??
Thanks,
Ashish
Koji Sekiguchi-2 wrote
Ashish P wrote:
> I have created a field,
> <fieldtype name="conditionText" class="solr.StrField" >
> <analyzer>
>        <tokenizer class="solr.PatternTokenizerFactory" pattern="_" />
> </analyzer>
>         </fieldtype>
>
>  
Set class="solr.TextField" instead of class="solr.StrField" in your
fieldType definition.
Then reindex and commit.

Koji
Reply | Threaded
Open this post in threaded view
|

Re: Field tokenizer question

Giovanni De Stefano
Hello Ashish,

as far as I know solr.StrField is not analized but it is indexed as is
(verbatim).

Cheers,
Giovanni


On 3/23/09, Ashish P <[hidden email]> wrote:

>
>
> Hey it works. Can you please tell me the reason??
> Thanks,
> Ashish
>
> Koji Sekiguchi-2 wrote:
> >
> > Ashish P wrote:
> >> I have created a field,
> >> <fieldtype name="conditionText" class="solr.StrField" >
> >>                      <analyzer>
> >>              <tokenizer class="solr.PatternTokenizerFactory" pattern="_"
> />
> >>                      </analyzer>
> >>         </fieldtype>
> >>
> >>
> > Set class="solr.TextField" instead of class="solr.StrField" in your
> > fieldType definition.
> > Then reindex and commit.
> >
> > Koji
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Field-tokenizer-question-tp22594575p22653356.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Field tokenizer question

hossman

: as far as I know solr.StrField is not analized but it is indexed as is
: (verbatim).

correct ... but there is definitely a bug here if the analysis.jsp
is implying that an analyzer is being used...

https://issues.apache.org/jira/browse/SOLR-1086




-Hoss