We do search in attachments by default but the search results are indeed pages (documents) by default, meaning that a page is returned if one of its attachments are matching the search query. You can test this by searching for “logo” which should return the Sandbox page because it has an attachment matching the search query.
If you want to have attachments directly as search results by default then you need to edit the Main.SolrSearchConfig page and modify the facetQuery by replacing:
sorry for this noob question.
after 2 hours i gave up to locate Main.SolrSearchConfig on my system.
can you give me a hint where to search?
its a ubuntu i18.04 system
Sry to bump this old thread, but I found it because I have a similar problem.
I want to do a search in XWiki only in the content of pages. But unfortunately, I also get search results for attachments of the pages. Filter is “f_type=DOCUMENT”
This seems to be the reason:
This is not as expected. If I want to search attachements, I would add attachements as search criteria.
How can I prevent XWiki from having this behaviour? How can I actual only search for words in page contents?
→ it should also be 2 for document type in that case … ?!
PS: Do I need to delete the fields also from phraseFields, bigramPhraseFields and so on?
I don’t understand, what the entries phaseFields (and so on) stands for.
I commented on the reported issue. Unfortunately I don’t think this is a bug but rather a limitation (by design) that prevents you from cleanly configure the search to not match attachments when looking for wiki pages (without some unexpected side effects).