[ 
https://issues.apache.org/jira/browse/LUCENE-4461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13472429#comment-13472429
 ] 

Rodrigo Vega commented on LUCENE-4461:
--------------------------------------

Yes, I know that but i need a generic way to handle the facet requests during 
search preparation stage. For that reason I have a FacetParams object with the 
following properties: int limit, String[] path, boolean filter

Then I can have some peace of code like this:

{code}
// Query is a bean that wraps a lucene query just to make easy the integration 
with our UI. REal lucene query is // handle by "q"
if (query.isFaceted())
        for (FacetParams facet : query.getFacet()) {

                CategoryPath c = new CategoryPath(facet.getPath());
                facetSearchParams.addFacetRequest(new CountFacetRequest(c, 
facet.getLimit()));

                if (facet.isFilter())
                        q = DrillDown.query(q, c);

        }
... preapre collectors and finally search
{code}

This is because the user can create its own query using some kind of wizard. So 
I have two options:
* Support this feature
* Avoid configurations with this kind of cases.

It is not a really big problem it is mostly about how to keep my code as neat 
as I can :) . I can't ask you to solve my code issues :D
                
> Multiple FacetRequest with the same path creates inconsistent results
> ---------------------------------------------------------------------
>
>                 Key: LUCENE-4461
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4461
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/facet
>    Affects Versions: 3.6
>            Reporter: Rodrigo Vega
>              Labels: facet, faceted-search
>         Attachments: LuceneFacetTest.java
>
>
> Multiple FacetRequest are getting merged into one creating wrong results in 
> this case:
> FacetSearchParams facetSearchParams = new FacetSearchParams();
>               facetSearchParams.addFacetRequest(new CountFacetRequest(new 
> CategoryPath("author"), 10));
>               facetSearchParams.addFacetRequest(new CountFacetRequest(new 
> CategoryPath("author"), 10));
> Problem can be fixed by defining hashcode and equals in certain way that 
> Lucene recognize we are talking about different requests.
> Attached test case.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to