Borykam się z problemem odpowiedniego szukania danych zaindexowanych w ES.
Mój index wygląda mniej więcej tak:
Kod
app:
client: default
index_name: app_%kernel.environment%
types:
country_data:
mappings:
id:
type: integer
postal_code:
type: string
name:
type: string
city:
type: string
voivodeship:
type: string
address:
type: string
district:
type: string
range:
type: string
community:
type: string
gus_voivodeship:
type: string
gus_district:
type: string
gus_community:
type: string
gus_community_type:
type: string
gus_symbol:
type: string
persistence:
driver: orm
model: MojBundle\Entity\CountryData
provider: ~
listener:
immediate: ~
finder: ~
client: default
index_name: app_%kernel.environment%
types:
country_data:
mappings:
id:
type: integer
postal_code:
type: string
name:
type: string
city:
type: string
voivodeship:
type: string
address:
type: string
district:
type: string
range:
type: string
community:
type: string
gus_voivodeship:
type: string
gus_district:
type: string
gus_community:
type: string
gus_community_type:
type: string
gus_symbol:
type: string
persistence:
driver: orm
model: MojBundle\Entity\CountryData
provider: ~
listener:
immediate: ~
finder: ~
Szukałem tego mniej więcej tak:
$city->setFieldQuery('city', $query); $postalCode->setFieldQuery('postal_code', $query); $district->setFieldQuery('district', $query); $voivodeship->setFieldQuery('voivodeship', $query); $address->setFieldQuery('address', $query); $boolQuery ->addShould($city) ->addShould($postalCode) ->addShould($district) ->addShould($voivodeship);
Lecz dla stringa 60-564 wielkopolskie poznań jezyce Grodziska dostaję dane często nie pasujące do tego patternu (np. zupełnie różny kod pocztowy)
Jakieś sugestie?