Range Searches

19 views
Skip to first unread message

Osullivan L.

unread,
Sep 17, 2012, 5:58:14 AM9/17/12
to vufin...@lists.sourceforge.net, solrma...@googlegroups.com
Hi Folks,

I'm trying to implement a normalized LC Callnumber field based on the code found in SolrMarc tools which can be used for sorting and range searches. The sorting works as expected but the range searches only seem to work on the LC alpha sequence (e.g. BA - CF). Does anyone know if Solr capable of alphanumeric ranges?

Thanks,

Luke

Demian Katz

unread,
Sep 17, 2012, 10:03:51 AM9/17/12
to solrma...@googlegroups.com, vufin...@lists.sourceforge.net

I can’t think of any reason why Solr would be unable to handle an alphanumeric range.  Have you tried looking at a query with debugQuery=true to see if that reveals any clues?

 

- Demian

--
You received this message because you are subscribed to the Google Groups "solrmarc-tech" group.
To post to this group, send email to solrma...@googlegroups.com.
To unsubscribe from this group, send email to solrmarc-tec...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/solrmarc-tech?hl=en.

Robert Haschart

unread,
Sep 17, 2012, 10:24:04 AM9/17/12
to solrma...@googlegroups.com
Depending on how the field is being indexed by Solr, it might be tokenized, which would split the index entry on the spaces following the initial letters.   Check your schema.xml file for Solr. 

The field you are using should be defined something like this:

   <field name="callnumber-normalized" type="string" indexed="true" stored="true" multiValued="false"/>

If the type is defined as "text" then that is the cause of the problem.

-Bob Haschart

Osullivan L.

unread,
Sep 18, 2012, 9:09:25 AM9/18/12
to solrma...@googlegroups.com
Hi Bob,

Thanks for your e-mail.

I've set up the field using:

       <fieldType name="LCNormalized" class="solr.TextField" sortMissingLast="true" omitNorms="true">
        <analyzer>
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="org.vufind.solr.analysis.LCCNormalizeFilterFactory"/>
        </analyzer>
    </fieldType>

<field name="callnumber-normalized" type="LCNormalized" indexed="true" stored="true"/>

Should I explicitly set multiValued to false and try using solr.StrField (if that is possible with the tokenizer)?

Thanks,

Luke



From: solrma...@googlegroups.com [solrma...@googlegroups.com] on behalf of Robert Haschart [rh...@virginia.edu]
Sent: 17 September 2012 15:24
To: solrma...@googlegroups.com
Subject: Re: [solrmarc-tech] RE: Range Searches

Reply all
Reply to author
Forward
0 new messages