PT Fuzzy Search Reindexing
Step 1:
Get the current mapping of the pt index using the _mapping API
GET /property-services/_mapping
Step 2:
Add the following json mappings in the existing mappings (parallely to properties key):
"_source": {
"excludes": [
"Data.street",
"Data.doorNo",
"Data.ownerNames"
]
}
Sample QA final mapping for reference is attached at the end.
Step 3:
Recreate property-services-enriched with the new mapping.
Step 4:
Update the indexer configuration, add the following 3 fields ownerNames
, doorNo
, street
in custom mapping as added below in sample configuration:
https://github.com/egovernments/configs/blob/qa/egov-indexer/property-services.yml
** If search has to be enabled only on names of only ACTIVE user, configure indexer jsonPath accordingly. Use $.owners[*][?(@.status=='ACTIVE')].name
instead in the config
Step 5:
Restart indexer
Step 6:
Trigger reindexing
Steps followed for Reindexing on QA env:
Recreated property-services-enriched index with the new mapping
Created kafka connector
Hit the legacy index api
Once data is indexed in property-services-enriched, verify that all the data is indexed
After validating the data, drop the property-services index and use alias to point
property-services
toproperty-services-enriched
POST /_aliases
{
"actions": [
{
"add": {
"index": "property-services-enriched",
"alias": "property-services"
}
}
]
}
Sample mappings from QA env: