0
我使用FOQElasticaBundle將Elastic Search集成到我的Symfony2項目中。我有一個名爲Recipe
的實體,此實體具有屬性$draft
,表明配方尚未完成。我想從彈性搜索結果中排除具有屬性$draft = 1
的食譜。根據字段內容排除Elastic Search的結果
這是我foq_elastica配置的一部分:
...
types:
chef:
mappings:
surname: {boost: 5}
name: {boost: 4}
nbLikes: { index: not_analyzed }
nbFollowers: { index: not_analyzed }
persistence:
driver: orm
model: Interacso\ApiBundle\Entity\Chef
identifier: id
provider: ~
finder: ~
listener: ~
recipe:
mappings:
name: {boost: 100}
chefName: {boost: 10}
chefSurname: {boost: 10}
bookNames: {boost: 5}
ingredientNames: {boost: 2}
tagNames: {boost: 2}
persistence:
driver: orm
model: Interacso\ApiBundle\Entity\Recipe
identifier: id
provider: ~
finder: ~
listener: ~
....
什麼建議嗎?