php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59181 SolrQuery::setFacetMinCount() does not work on field which have underscore '_'
Submitted: 2010-04-26 17:18 UTC Modified: 2010-04-27 22:52 UTC
From: kantumesh at yahoo dot com Assigned:
Status: Not a bug Package: solr (PECL)
PHP Version: 5.2.6 OS: Ubuntu 4.5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kantumesh at yahoo dot com
New email:
PHP Version: OS:

 

 [2010-04-26 17:18 UTC] kantumesh at yahoo dot com
Description:
------------
SolrQuery::setFacetMinCount() does not work on field which 
have underscore '_' in the field name.

For ex- 
$this->_solrQuery->addFacetField("XYZ_Info");
$this->setFacetMinCount(1, "XYZ_Info");

Reproduce code:
---------------
$this->_solrQuery->addFacetField("XYZ_Info");
$this->setFacetMinCount(1, "XYZ_Info");

Expected result:
----------------
query should have f.XYZ_Info.facet.mincount=1

Actual result:
--------------
could see f.<field name>.facet.mincount=1 for all other 
fields which do not have an underscore in the name.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-27 22:52 UTC] iekpo@php.net
I attempted this and I got the correct result.

This is the code

$q = new SolrQuery();

$q->addFacetField("XYZ_Info");
$q->addFacetField("under_score")->addFacetField("photos");

$q->setFacetMinCount(3, "under_score");
$q->setFacetMinCount(2, "photos");
$q->setFacetMinCount(1, "XYZ_Info");

echo $q->toString(), "\n";


This is the result

facet.field=XYZ_Info&facet.field=under_score&facet.field=photos&f.under_score.facet.mincount=3&f.photos.facet.mincount=2&f.XYZ_Info.facet.mincount=1

Which is the expected result
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC