Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 928 Bytes

search.md

File metadata and controls

23 lines (15 loc) · 928 Bytes

##List of supported search method

from,size,sortBy,minScore,ids,term,terms,wildcard,matchAll,match,multiMatch,geoBoundingBox,geoDistance,geoDistanceRange,geoHash,geoPolygon,prefix,queryString,simpleQueryString,range,regexp,commonTerm,fuzzy,nested,aggregation

Plastic doesn't support all available search queries yet like the dismax query however you can still implement this functionality.

Knowing that Plastic uses ongr-io/ElasticsearchDSL to build the queries we can do the following.

$termQuery1 = new TermQuery('age', 34);
$termQuery2 = new TermQuery('age', 35);

$disMaxQuery = new DisMaxQuery();
$disMaxQuery->addParameter('tie_breaker', 0.7);
$disMaxQuery->addParameter('boost', 1.2);
$disMaxQuery->addQuery($termQuery1);
$disMaxQuery->addQuery($termQuery2);

Post::search()->append($disMaxQuery)->get();