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 Scott Smerchek <sc...@gmail.com> on 2012/07/24 23:11:08 UTC

Realtime Get and lowercased id fields

I'd like to get documents using the RealtimeGetHandler. However, we have a
lowercased id field because our id's are case-insensitive and it does not
match documents regardless of case.

Here's the relevant schema parts.
<field name="id" type="lowercase" indexed="true" stored="true"
required="true" />
<uniqueKey>id</uniqueKey>

<fieldType name="lowercase" class="solr.TextField"
positionIncrementGap="100">
   <analyzer>
      <tokenizer class="solr.KeywordTokenizerFactory"/>
      <filter class="solr.LowerCaseFilterFactory" />
   </analyzer>
</fieldType>

Indexed document:
<doc>
  <field name="id">CaSEinsensiTIVE</id>
</doc>

A /get?id=CaSEinsensiTIVE does not return the document.
A /get?id=CASEINSENSITIVE does not return the document.
A /get?id=caseinsensitive DOES return the document.

I expected /get to behave like /select and perform the same analysis on the
field as it was indexed with. Is this intentional in how NRT Get works?
What is the recommended way to do this sort of thing other than to do a
.ToLower() on the id before I do a /get?

Thanks.

- Scott Smerchek