I'm using Symfony 5.4. Indexing Item, Product, Event and Test entities. Since Test don't have content property, i want to add higher boost to Test title property, but i don't find information if it is event possible. Someone had same problem?
I tried adding this condition in main query, but what it applies higher boost to all Entities if one of them is Test.
if ($this->indexManager->getIndex('test')) {`
`$matchPhrase = new MatchPhrase();`
`$matchPhrase->setFieldQuery('title.raw', $term);`
`$matchPhrase->setFieldParam('title.raw', 'slop', 3);`
`$matchPhrase->setFieldBoost('title.raw', 10);`
`$bq->addShould($matchPhrase);`
}
yes you can boost a field like:
[...]
types:
autor:
properties:
orig_id:
type: "integer"
property_path: origId
boost: 10