Solr: research in fields with relevance -


i'm using solr 5.4.1 , documents have following xml structure:

<?xml version ="1.0" ?>     <add >         <doc >             <field name ="title">us, qatar extend talks overformer taliban detainees - wall street journal</field>             <field name ="date">2015-05-31t23:39:45z</field>             <field name ="description">the u.s. , qatari governments have extended talks on fate of 5 former afghan taliban prisoners ho released guantanamo bay prison year ago in exchange american soldier , u.s. officials said sunday.</field>         </doc > </add > 

as can see structure, there fields title , description.

i tests:

1) search text in both fields if 1 unique field.

2) search text in both fields giving different relevance weight each field (e.g. 80% description , 20% title).

i know can use parameter qf specify search (fields); know there boolean operator and specified in parameter q.

which 1 of above mentioned tecniques can use each tests?

  1. if want search both fields single field, add new field (i.e. title_description) , use 2 copyfield instructions copy content both fields common field:

  2. you can use qf description^4 title give hits in description 4 times weight of hits in title. give 80/20 ratio, remember scoring more complex simple percent weights between fields - length of content, number of times term present, position between fields (if using phrase boosting), etc.


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo