1. Search from the content domain
In solrconfig. xml obtained from SOLR example, QF is defined as follows:
[HTML]View plaincopy
- <STR name = "QF">
- Text ^ 0.5 features ^ 1.0 name ^ 1.2 SKU ^ 1.5 ID ^ 10.0 Manu ^ 1.1 cat ^ 1.4
- Title ^ 10.0 description ^ 5.0 keywords ^ 5.0 author ^ 2.0 resourcename ^ 1.0
- </STR>
Because content does not take any weight, if a document only contains keywords in content, the search result does not return this document. Therefore, you need to increase the content weight and URL weight (if needed) for the index extracted by nutch ):
[HTML]View plaincopy
- <STR name = "QF">
- Content ^ 1.0 text ^ 0.5 features ^ 1.0 name ^ 1.2 SKU ^ 1.5 ID ^ 10.0 Manu ^ 1.1 cat ^ 1.4
- Title ^ 10.0 description ^ 5.0 keywords ^ 5.0 author ^ 2.0 resourcename ^ 1.0
- </STR>
2. Save the content of the webpage
In schema. XML
<field name="content" type="text" stored="false" indexed="true"/>
Change
<field name="content" type="text" stored="true" indexed="true"/>
3. display both webpage files and general text
Velocity/results_list.vm
##parse("hit_plain.vm")Remove comments.
4. Adjust the display content of each search return item
VI richtest_doc.vm
<div> Id: #field('id')</div>Changed:
<div> time: #field('tstamp')</div><div> score: #field('score')</div>This method can modify other fields, see http://blog.csdn.net/jediael_lu/article/details/38039267