bielu / bielu.examine.providers

MIT License
1 stars 1 forks source link

Backoffice Search returns no or wrong results #11

Closed mcl-sz closed 2 months ago

mcl-sz commented 6 months ago

When you use the Backoffice Search with the ElasticSearch-provider enabled, the results do not match the searchstring. For testing i used Paul Seal's Clean Starterkit.

For example, if you search for the page "About" these results are shown:

afbeelding

afbeelding

afbeelding

bielu commented 6 months ago

I will have a look this or next weekend

mcl-sz commented 6 months ago

I think I have found the source of the problem. It appears that the Analyzers are not being set. The query is lowercased, so that, for example, a node with key "ab...." is found, but the node name with "Ab" is not.

I'll see if I can make an adjustment for this.

mcl-sz commented 6 months ago

I have tried to set up the Analyzer but am not getting the desired result yet. I suspect that my knowledge of this is not sufficient unfortunately. Would you like to take a look at this yourself?

What is also noticeable is that the query is also executed on the __Key field. +(+(nodeName:a* nodeName_en-us:a* id:a* __NodeId:a* __Key:a*) +__IndexType:content)

Because this is a Guid it does not contain any relevant data.

bielu commented 6 months ago

@mcl-sz this query means: it has to be, both

bielu commented 6 months ago

@mcl-sz this one is resolved now, version 1.0.0-beta.638479375162914272 should help you

mcl-sz commented 6 months ago

Hi @bielu, the backoffice search works better now, but unfortunately matches based on keys are still found, resulting in irrelevant results.

afbeelding

The query +(+(nodeName:ab^10.0 nodeName_en-us:ab^10.0 nodeName:ab* nodeName_en-us:ab* id:ab* __NodeId:ab* __Key:ab*) +__IndexType:content)

Gives this result in Kibana:

afbeelding

However, I only now saw that this is exactly the same with Examine Lucene, simply because the __Key is also included in the query there.

afbeelding

I can imagine that it is useful that you can also search by keys, but it now clouds the results. It might be an idea to check whether a search query is a Guid and that it can then be searched for. It looks like they were planning something like that in Examine Lucene too, but it wasn't worked out properly; https://github.com/umbraco/Umbraco-CMS/blob/b0016687eb583a549da8992f5fba92e269b4cbfa/src/Umbraco.Examine.Lucene/BackOfficeExamineSearcher.cs#L80

What are your thoughts on this?

bielu commented 6 months ago

@mcl-sz I will need investigate it further, but approach of umbraco is not really an good solutions here.

mcl-sz commented 6 months ago

I've created an issue under Umbraco-CMS as well because in the base the query sent from Umbraco does not produce the desired result. https://github.com/umbraco/Umbraco-CMS/issues/16003

bielu commented 2 months ago

@mcl-sz I am closing this ticket as this has to be fixed in umbraco not provider. :)