dear all:
right now I just have meet a problem with solr, just as following:
in our database, there are some fields just like "title", "author", "text",
"date" etc, and we make them all in our index db, and we just make a special
index field named "content" just include "title", "author", "text" and "date",
for example:
<doc> <str name="title">Harry Potter</str> <str name="author">J.K.Rowling</str>
<str name="text">Harry has been burdened with a dark, dangerous and seemingly
impossible task: that of locating and destroying Voldemort’s remaining
Horcruxes</str> <str name="date">2006</str> <str name="content">Harry Potter
J.K.Rowling Harry has been burdened with a dark, dangerous and seemingly
impossible task: that of locating and destroying Voldemort’s remaining
Horcruxes 2006</str></doc><doc> <str name="title">Harry Potter and the Deathly
Hallows</str> <str name="author">J.K.Rowling</str> <str name="text">In this
final, seventh installment of the Harry Potter series, J.K. Rowling unveils in
spectacular fashion the answers to the many questions that have been so eagerly
awaited</str> <str name="date">2007</str> <str name="content">Harry Potter and
the Deathly Hallows J.K.Rowling In this final, seventh installment of the Harry
Potter series, J.K. Rowling unveils in spectacular fashion the an
swers to the many questions that have been so eagerly awaited 2007</str></doc>
when we search a word just like "Rowling Deathly", the two indexs above will
be searched, and because the field "content" is include "title" and "author",
so we want the second index will be front of all the search result, that means
the word appear in the field "title" will be more important to the word appear
in the field "author", although we just search the filed content, we just hope
the weight of the field "title" is much higher than the weight of the field
"author" and hope the higher weight will at the top of the search result.
we just think another way to solve this problem, just as follows:
<copyField source="title" dest="content"/><copyField source="author"
dest="content"/><copyField source="text" dest="content"/><copyField
source="date" dest="content"/>
and then set boost at "title" to 2.0
http://localhost/solr/select/?q=content:Rowling +OR+ content:Deathly +OR+
title:Rowling +OR+
title:Deathly&version=2.2&start=0&rows=1000&indent=on&facet=true&facet.limit=-1&facet.field=title&facet.field=title&facet.mincount=1&f.title.facet.missing=true
I think this is a stupid method, because the search conditions is too long,
and the search efficiency will be low, we hope you can help me to solve this
problem.
_________________________________________________________________
谈话枯燥无味?让MSN魔法书来点缀您的MSN!
http://im.live.cn/emoticons/?ID=6