recently, I started working with XWiki and came across a question I couldn’t resolve by searching for an answer in the documentation:
Is there a way to search for a tag I added to a page?
So I have quite a lot of pages with a couple of nested pages and all have different tags assigned to it. And I’d like to search my entire Wiki for a specific tag.
I already came across the two links you posted, but that is not what I’m searching for.
Creating tags, editing tags and viewing all tags existing in my Wiki is working fine.
But I’m looking for the possibility to search for a tag and get a list of pages with it assigned to in a user friendly way i.e. I don’t want to have to deal with code.
I don’t quite like the overview of all my tags, since I have quite a lot.
Edit:
The Solr search application shows me, that I can add a new “search index”, if I’m getting this right? But I don’t get how to add this new index.
XWiki already has a search function. Everything I need, is to be able to get results when searching for a tag. These results should be the pages tagged with the tag I searched for.
I want to add weight to tag in search (for example, pages where tag with search word occurs will be higher in the search results). I think it may help (but my topic in progress).
update: In you case may be help add filter to search (if u want search only in tags and not in page title, descrition and etc)
Hey mflorea!
thank you for your reply. The search suggest source is activated as far as I know.
Here is my complete config, could you have a look, maybe I did something wrong somewhere.
@mflorea This works for me, too. However, suggestions from tag contents are only made if the search query respects capitalization in tags. That’s not what I want. Do I need all the tags to be lowercase?
The tags are stored using a Static List xobject property whose value is indexed in Solr as a “string”. This means the tags are not tokenized or analyzed in any way. They are indexed as is (i.e. a single token with the tag value), in order to help with exact matching. So yes, if you need free text search to match the tags then you need to use lowercase tags, and the user must search lowercase.
Thanks, @mflorea. Well, we are no Solr experts. How would we have to do that and will changes in managed-schema be overwritten with the next upgrade of XWiki?
and adjusted the page SolrSearchConfig in XWiki to use this new field with an appropriate weight: 'queryFields': { 'DOCUMENT': 'title^10.0 name^10.0 tag^5 …
The query in the correspondig tag source in Search Suggest in the XWiki admin section must be set, accordingly, to:
The Solr search core configuration is automatically reseted every time there is a change in the standard one or every time the version of the embedded Solr instance is upgraded (which pretty much always imply a change in the configuration), so I would really not recommend modifying it directly. Last time we did something that cause this core to be reseted was in 14.8, but it could happen any time (for example we will mosty probably upgrade to Solr 9.x in XWiki 15.x).
Honestly, while I worked a lot on low level Solr core integration in XWiki @mflorea is much more knowledgeable than me on how to query this specific core.
At worst, I guess you could simply have a process to make sure your customization are there after each upgrade (XWiki is not going to reset this core out of the blue, that’s only an upgrade thing).
Hi @vmassol@tmortagne@mflorea ,
isn’t what @jmiba has done already a good first version for Loading... ?
I mean if case sensitive vs insensitive is an issue, you could just add two “Tags” fields and the use could just add one or the other to the search suggest.
It would make it much easier to configure the search of tags.