Search handling with search phrase segmenting key words and boosting

32 views
Skip to first unread message

Johann Höchtl

unread,
Apr 7, 2023, 2:20:30 AM4/7/23
to bleve
Following case: 90% of search terms are like:

"beer to be served with meat"
"beer to be served with fish"
"beer to be served with cake"

some searches are like this:

"beer to be served with meat restricted for a BBQ"
"beer to be served with cake restricted for consumption on a wedding"

When restricted occures, the second part of the query should be more relevant

My take on this would be:

Query string pre-processing outside bleve. If restricted (and a couple of other words occur) I split the query in two:

query struct {
main string
boostpart string
}{main:"beer to be served with meat",
boostpart: "for a BBQ"
}

for insert into the bleve index.

If the separating key word doesn't exist, everything simply goes into 
{ main: "beer to be served with meat"}

Searching would be: Analyze the input, if a keyword occurs, split the query in two targeting the different fields with different boosting weights.

With this approach, pretty much every pre-processing happens outside bleve. is there a bleve functionality which would help me to achieve something comparable?
Reply all
Reply to author
Forward
0 new messages