You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by GitBox <gi...@apache.org> on 2020/05/04 10:03:22 UTC

[GitHub] [lucenenet] lukaskolafa opened a new issue #247: FacetsCollector.Search n Parameter unclear

lukaskolafa opened a new issue #247:
URL: https://github.com/apache/lucenenet/issues/247


   Hello, I am scratching my head, what is the purpose of the parameter `n` in the method `FacetsCollector.Search(..., n, ...)`. From various posts out there in internet (including java questions), it looks like the argument limits the results for Facets which deliver n+ hits. But this is not the behavior I observe, in my case, whatever number I use, the results is the same. Here is my code I use, based on the sample I found [here](https://github.com/apache/lucenenet/blob/master/src/Lucene.Net.Demo/Facet/SimpleFacetsExample.cs). 
   
   One suspicious place in the code is that the return value of the `Search` method is not used. But this is the same case as in the referenced github sample.
   
   any help is appreciated.. thank you!
   
   ```
               BooleanQuery searchQuery = this.CreateLuceneSearchQuery(performCourseSearchRequest);
   
               var facetsCollector = new FacetsCollector();
   
               /*
                * This value should theoretically limit the result to return only facets with at least N results (hits). For some reason this
                * seems not being working and regardless what the number is, it returns always everything.
                */
               const int NumHitsLimit = 1;
   
               // Return value is not used, the searchQuery affects the referenced facetsCollector
               _ = FacetsCollector.Search(catalogSearchContainer.GetCurrentIndexSearcher(), searchQuery, NumHitsLimit, facetsCollector);
   
               var facets = new FastTaxonomyFacetCounts(catalogSearchContainer.GetCurrentTaxonomyReader(), FacetsConfigFactory.CreateFacetsConfig(), facetsCollector);
   
               foreach (var facetField in facetFields)
               {
                   FacetResult facetResult = facets.GetTopChildren(MaxFacetChildrenHits, facetField);
   
                   if (facetResult != null)
                   {
                       facetResults.Add(new FacetItem(facetResult));
                   }
               }
   
               return facetResults;
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] NightOwl888 commented on issue #247: FacetsCollector.Search n Parameter unclear

Posted by GitBox <gi...@apache.org>.
NightOwl888 commented on issue #247:
URL: https://github.com/apache/lucenenet/issues/247#issuecomment-628955511


   For user related issues, you will be much more likely to get a response if you subscribe to and then post your question on the [user mailing list](https://lucenenet.apache.org/contributing/index.html#ask-a-question) or by posting your question on StackOverflow. Our GitHub issue tracker is for bug reports and tasks only.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [lucenenet] NightOwl888 closed issue #247: FacetsCollector.Search n Parameter unclear

Posted by GitBox <gi...@apache.org>.
NightOwl888 closed issue #247:
URL: https://github.com/apache/lucenenet/issues/247


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org