lucene - SOLR search by external fields -


what need similar discussed here, except not filter actual query: http://lucene.472066.n3.nabble.com/filter-query-from-external-list-of-solr-unique-ids-td1709060.html

we'd implement query parser/scorer allow combine solr searches searching external fields. due limitation of having update entire document though field in document needs updated.

for example have database table called document_attributes containing 2 columns document_id, attribute_id. document_id corresponds id of documents indexed solr.

we'd able pass in query like:

attribute_id:123 or text:some_query (attribute_id:123 or attribute_id:456) , text:some_query etc...

can implement plugin/module in solr that's able parse above query , fetch document_ids associated attribute_id , combine results normal processing of solr search return 1 set of results entire query.

we'd appreciate guidance on how implement if possible.

i repeat advice offered referenced question, qualification.

for solr < 4.0 2 approaches consider are:

  • doing documentid lookup before querying solr, , querying solr list of document ids (e.g. fq=(docid:1 or docid:5))

  • creating own derived solrqueryparser performs database query substitute document ids attribute ids (e.q. fq=attribute:1 expanded queryparser fq=(docid:1 or docid:5))

the decision should revolve around numer of document ids you'll sending solr. small, or event moderate (let's hundreds) of document ids sending ids filterquery best way go. if you're potentially sending large or large number of documentids extending queryparser case fair strategy. if extend query parser may want consider running on dedicated (non-default) request-handler, , building in aspects such caching ensure results remain hihgly performant.

for solr 4.0 , above might consider using cross-core join. have existing solr core remain as-is, , create new core indexes document:attribute relationships. should alleviate concerns whole document update, , allow execute whole query in solr, in-memory.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -