Ok,Ii got my FTS geo search working but I would like to search for more like limit on Zip code and street names as well on _type.
My document looks like this
{
“_id” :"xxx,
“_type”: “Residential”,
“_geo” : {“lat”: 123, “lng”: 345},
“Record” : {
“Address”: {
“City”: “Los Angeles”,
“Country”: “US”,
“PostalCode”: “90017”,
“PostalCodePlus4”: “5711”,
“StateOrProvince”: “CA”,
“StreetDirPrefix”: “W”,
“StreetDirSuffix”: “”,
“StreetName”: “7th”,
“StreetNumber”: “”,
“StreetNumberNumeric”: “818”
} }}
What i am struggling is how to create an index for example for PostalCode and StreetName. To i create an index on Record.Address.PostalCode and then specify Record.Address.PostalCode as the field i want to match or do i create.
Like this
or this
Also how high is the performance Hit if i would Index The whole Object Record.Address and would i still be able to search / match values on individual fields. ’
Another question is how would i tell FTS which index to use if a bucket has multiple Indexes as the Index to use is specified in the URL if i do a CURL but i have not seen anything if i do a N1QL query with where search (…)
Here is what the index i played around with without geo index …
{
“name”: “CRML_RES”,
“type”: “fulltext-index”,
“params”: {
“doc_config”: {
“docid_prefix_delim”: “”,
“docid_regexp”: “”,
“mode”: “type_field”,
“type_field”: “_type”
},
“mapping”: {
“default_analyzer”: “standard”,
“default_datetime_parser”: “dateTimeOptional”,
“default_field”: “_all”,
“default_mapping”: {
“dynamic”: true,
“enabled”: false
},
“default_type”: “_default”,
“docvalues_dynamic”: true,
“index_dynamic”: true,
“store_dynamic”: false,
“type_field”: “_type”,
“types”: {
“Record”: {
“dynamic”: false,
“enabled”: true,
“properties”: {
“Address”: {
“dynamic”: false,
“enabled”: true,
“properties”: {
“PostalCode”: {
“enabled”: true,
“dynamic”: false,
“fields”: [
{
“docvalues”: true,
“include_in_all”: true,
“include_term_vectors”: true,
“index”: true,
“name”: “PostalCode”,
“store”: true,
“type”: “text”
}
]
}
}
}
}
},
“Record.Address.PostalCode”: {
“dynamic”: true,
“enabled”: true
},
“_type”: {
“dynamic”: false,
“enabled”: true
}
}
},
“store”: {
“indexType”: “scorch”
}
},
“sourceType”: “couchbase”,
“sourceName”: “rets”,
“sourceUUID”: “68ba50313fd833d089e0c9704188988f”,
“sourceParams”: {},
“planParams”: {
“maxPartitionsPerPIndex”: 171,
“indexPartitions”: 6,
“numReplicas”: 0
},
“uuid”: “70574e5fa3b5fedc”
}