Do you want to use a field's content do decide whether the document should be 
indexed or not?
You could write an UpdateProcessor for that, simply aborting the chain for the 
docs that don't pass your test.

@Override
public void processAdd(AddUpdateCommand cmd) throws IOException {
    SolrInputDocument doc = cmd.getSolrInputDocument();
    String value = (String) doc.getFieldValue("myfield");
    String condition = "foobar";
    if(value == condition) {
        super.processAdd(cmd);
    }
}

But if what you meant was to skip only that field if it does not match 
condition, you could use doc.removeField(name) instead. Now you can feed your 
content using whatever method you like.

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com

On 25. okt. 2010, at 08.38, Pawan Darira wrote:

> Hi
> 
> I want to index a particular field on one if() condition. Can i do it
> through DIH?
> 
> Please suggest.
> 
> -- 
> Thanks,
> Pawan Darira

Reply via email to