0

I have multiple index in my project. With help of a field type I can sort documents and get needed results. So, no problem so far. But how can I implement boosted query for each type? For example I have now in solrconfig.xml something like:

<str name="qf">title^10 description^5 keywords^3 content^2</str>

As far as I understand this will work for all types of my search. I need functionality which allows me to boost different fields depending on which type of search I am executing. Like if type = teacher then <str name="qf">title^2 content^5</str>, if type = pilot then <str name="qf">title^1 description^10 content^15</str> Is it possible? If yes, how?

And if I search in all types and have matches in pilot and teacher, but want to show results of type teacher first. How can I achieve htis?

I would appreciate any possible help, also would like to know if it's possible without using different cores to make different boosts per index, because it might be a total overkill for the project right now.

sehe
  • 374,641
  • 47
  • 450
  • 633
  • cant you build the query with those condition before firing it to solr...? – Abhijit Bashetti May 11 '16 at 07:21
  • 1
    That is not exactly what I was searching for. I thought there might be a possibility to do it directly in solrconfig file, but probably not. Instead, if someone is facing a similar problem, I defined different requestHandlers in solrconfig like /select and each handler has different boost parameters. In java app, depending what kind of search should be done (only pilot or teacher), then get needed handler with setRequestHandler("/yourHandler") and add it to query. And that's it – middleendian May 13 '16 at 16:37

0 Answers0