php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72740 addQueryField return wrong query
Submitted: 2016-08-03 00:27 UTC Modified: 2017-10-24 06:30 UTC
From: hardalau dot claudiu at gmail dot com Assigned:
Status: Open Package: solr (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hardalau dot claudiu at gmail dot com
New email:
PHP Version: OS:

 

 [2016-08-03 00:27 UTC] hardalau dot claudiu at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/solrdismaxquery.addphrasefield
---

        $dismaxQuery = new SolrDisMaxQuery($search);
        $dismaxQuery
            ->addPhraseField("fundraiseTitleExact", 10, 5);
...

returns [pf] => fundraiseTitleExact^5^10
but should return [pf] => fundraiseTitleExact~5^10

        

Test script:
---------------
        $dismaxQuery = new SolrDisMaxQuery($search);
        $dismaxQuery
            ->addPhraseField("fundraiseTitleExact", 10, 5);
...

returns [pf] => fundraiseTitleExact^5^10
but should return [pf] => fundraiseTitleExact~5^10




Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-09-29 15:56 UTC] omars@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: omars
 [2017-10-24 06:30 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: omars +Assigned To:
 [2019-07-11 21:48 UTC] matteo dot scaramuccia at gmail dot com
For the record, this issue has been already addressed in https://github.com/php/pecl-search_engine-solr/commit/b1b44e0a22bcce8f625707248d0b4d3630935359#diff-ab0834017b5c60ae382501bce9a32bbc but that commit added a regression when using AddQueryField() with no boost value.

The recent 2.5.0 is broken unless using the workaround of passing a boost value.

A PR to address this regression is available in https://github.com/php/pecl-search_engine-solr/pull/16.

HTH,
Matteo
 [2019-07-12 20:25 UTC] matteo dot scaramuccia at gmail dot com
The following pull request has been associated:

Patch Name: Fixes regression added while fixing Bug #72740
On GitHub:  https://github.com/php/pecl-search_engine-solr/pull/16
Patch:      https://github.com/php/pecl-search_engine-solr/pull/16.patch
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 10:01:24 2019 UTC