lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Composite key for uniqueKeyId
Date Sat, 08 Mar 2008 01:59:48 GMT

I believe Norberto ment he was handling it in his update client code -- 
before sending the docs to Solr.

Something that *seems* possible but I've never actaully tried is writting 
a "ConcatTokenFilterFactory" that queues up all the tokens and joins 
them together (using some confiured string, defaulting to "")  then you 
could in theory do something like this...

    <fieldType name="compositeKeyType" class="solr.TextField" omitNorms="true">
      <analyzer>
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.ConcatTokenFilterFactory" delim="-"/>
      <analyzer>
    </fieldType>
    ...
    <field name="compositeKey" type="compositeKeyType" />
    <uniqueKey>compositeKey</uniqueKey>
    ...
    <copyField source="type"  dest="compositeKey"/>
    <copyField source="numId" dest="compositeKey"/>
    ...

that *might* work ... but things would be a little weird when viewing your 
results (compositeKey would have to be multivalued, and it would return as 
an array)


-Hoss


Mime
View raw message