You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.
While using Examine.Facets.MultiFacets, I noticed the values added to a facet aren't used to filter the results and the TotalItemCount reflects the cumulative facet hits, not the amount of returned results.
I've added/configured the FacetSearcher in a component using:
if(this.examineManager.TryGetIndex("ExternalIndex",outvar index)&&
index is LuceneIndex luceneIndex){varsearcher=new MultiFacetSearcher("FacetSearcher", luceneIndex.GetIndexWriter(), luceneIndex.DefaultAnalyzer, luceneIndex.FieldValueTypeCollection);this.examineManager.AddSearcher(searcher);
luceneIndex.FieldDefinitionCollection.AddOrUpdate(new FieldDefinition("creatorName", FieldDefinitionTypes.Raw));}
if(this.examineManager.TryGetSearcher(Constants.ExternalFacetSearcher,outvar searcher)){varquery= searcher.CreateQuery(IndexTypes.Content).Facet("creatorName").And().NodeTypeAlias("newsMessage");varresults= query.Execute();varsameResultsCount= results.Count()== results.TotalItemCount;// False, although this should be TruevarsameHitsCount= results.GetFacet("creatorName").Sum(f => f.Hits)== results.TotalItemCount;// True, although this doesn't have to be the case}
The text was updated successfully, but these errors were encountered:
By default both BoboBrowse and MultiFacets return all facets for a given search - this is because MinHits is 0, so even facets without a match in the given result set are returned. If you wish to only return matching facets you must set MinHits to an appropriate level, like so:
query.Facet("field", "value").MinHits(1);
However, an issue in v1.0.0 means the MinHits() method hasn't been working... 🤪 This is fixed in v1.1.0!
While using
Examine.Facets.MultiFacets
, I noticed the values added to a facet aren't used to filter the results and theTotalItemCount
reflects the cumulative facet hits, not the amount of returned results.I've added/configured the
FacetSearcher
in a component using:The text was updated successfully, but these errors were encountered: