Some issue with Solr and quicksearch with multiple words

Hello,
I have some issues with solr and xwiki Quick Search feature.
When I type 2 word in quick search input field, highest results are pages with the highest occurrence of the individual terms and not documents with all terms.
On my xwiki v9.11.4 I apply this fix:
https://github.com/xwiki/xwiki-platform/pull/617/files from https://forum.xwiki.org/t/solr-relavancy-order-incorrect-when-using-multiple-words-in-a-query/865
Main.Search working well now but not ajaxCode of the quickSearch :frowning:
If I type “Tableau P3”, first Document name displayed are “Tableau xxx”, “Tableaux yy” and “Bla bla Tableaux” and I would expect “Tableau with P3” document displayed first…
How can I fix it?

By the way, I want to exclude some space from solr indexing.
Then I must add somethning like “fq!=space_exact:Sandbox” in xwiki setting-search-suggest search - solr Document name (/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&section=searchSuggest)?

Thxs.
Pascal B

That’s because XWiki.SuggestSolrService (actually XWiki.SuggestSolrMacros) doesn’t use Main.SolrSearchConfig. Can you report an issue please?

Thanks,
Marius

https://jira.xwiki.org/browse/XWIKI-15581

Do you know how I can exclude some spaces from solr indexing?

There’s no easy way to exclude spaces from indexing. It’s easy to exclude from search, but to exclude from indexing you would have to overwrite some XWiki components (Java code).

Cool then… Could you tell me how to do that?
My use case: I want exclude documents of Sandbox space (and maybe other spaces) from quicksearch result.
I try to use “space_exact” keyword in XWiki/XWikiPreferences/suggest search/document name but I didn’t manage (syntax issue or missing feature?)

(In last ressort I can hide sandbox documents)

fq=-space_exact:Sandbox

This seems to work for me.

Great! Thanks :slight_smile:

@Pbas, Thanks for this. I’ve been meaning to discuss this too as I noticed this after I adjusted the config and haven’t had the time.

Ben

nope, thxs to you @ben.megson about your pf parameter :wink:
I have these now in my XWiki/XWikiPreferences/suggest settings:

fq=type:DOCUMENT
qf=title^2 name
pf=title^2 name
fq=-space_exact:Sandbox
fq=-space_exact:Dashboard
fq=-space_exact:SandboxTemplate

I seem efficiant. Anyways I don’t know if the syntax is correct (maybe I must remove “qf=title^2 name” line ?)

@Pbas,
If you’re trying to replicate the pf parameter config as active in the main search but in the suggest settings, I don’t think it will work.

You might be able to get close by doing what you suggested above, however, note that pf weights should always be higher than qf weights. Also, you might have to enclose multiple terms in quotes or have a separate pf line for each.

:ok_hand: ty