How to return column that matched the query in Solr..?

后端 未结 1 1314
野性不改
野性不改 2020-12-20 00:23

I am using apache Solr for searching my database..!!

Suppose i have indexed 4 columns from one of my table..!!..I just want that only those columns that

1条回答
  •  醉梦人生
    2020-12-20 01:05

    You may be able to do this with Solr 4 and a custom transformer - my reading of the documentation would seem to indicate as much. But it would be quite a bit of work, I think. Ultimately you may have to write a front-end filter, but that would be difficult with complex queries.

    Update: Here's how to do this in Solr without custom transformers, etc. Enable highlighting for all four columns:

    hl=on&hl.fl=name,displayName,description,extra
    

    Solr will return a "highlighting" structure containing the key and the field(s) that match the query. You will also get highlighted snippets, whether you use them is up to you. See here for additional params: http://wiki.apache.org/solr/HighlightingParameters

    0 讨论(0)
提交回复
热议问题