php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #67101 Support Dismax/EDismax Query Parser
Submitted: 2014-04-21 10:44 UTC Modified: 2015-01-17 15:08 UTC
From: aliuz1 at gmail dot com Assigned: omars (profile)
Status: Closed Package: solr (PECL)
PHP Version: 5.5.11 OS: Ubuntu 12.04
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: aliuz1 at gmail dot com
New email:
PHP Version: OS:

 

 [2014-04-21 10:44 UTC] aliuz1 at gmail dot com
Description:
------------
Hello,

I'm not sure if it's already available but after looking at the documentation extensively I am at a loss on how to add parameters for implementing dismax/edismax for my queries. I would like to construct a query similar to the following:

q=partydress&defType=edismax&mm=2

But I don't think there is a way with the current release. Please correct me/lead me in the right path if I am wrong. Otherwise, I would think this to be a useful change request.

Thank you,

Ali.

Test script:
---------------
No test scripts because the operation requested is not supported at the moment


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-06-07 14:38 UTC] omars@php.net
Hello Ali,

Thanks for pointing that out, DisMax/eDisMax query parsers are not currently supported natively, but their support will be implemented very soon.

For the time being you can use dismax/edismax by utilizing SolrQuery::setParam() method (inherited from SolrModifiableParams) as the following example:
$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,
);

$client = new SolrClient($options);

$query = new SolrQuery();
$query->setQuery('partydress');
$query->setParam('defType', 'dismax');

// any additional fields
$query->setParam('q.alt','*:*');
$query->setParam('mm', 2);
$query->setParam('qf', 'features^20.0 text^0.3');
....etc

refs: 
http://www.php.net/manual/en/class.solrquery.php
http://www.php.net/manual/en/class.solrmodifiableparams.php
 [2014-06-07 14:41 UTC] omars@php.net
-Assigned To: +Assigned To: omars
 [2015-01-10 22:08 UTC] omars@php.net
-Summary: Any support for dismax/edismax parameters? +Summary: Support Dismax/EDismax Query Parser
 [2015-01-10 22:08 UTC] omars@php.net
Changed title
 [2015-01-17 15:08 UTC] omars@php.net
-Status: Assigned +Status: Closed
 [2015-01-17 15:08 UTC] omars@php.net
Implemented PECL Solr 2.1.0/master
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 06:01:32 2025 UTC