-
-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong Result in search query #556
Comments
Hey @mohitgoyal201617, To help us out, can you send along some full queries that demonstrate both the good and bad behavior? You can use our compare tool to look at the queries, and send along the links to that tool. Thanks! |
I have modified punctutions.js(Schema) commented '-' in allowed character. |
Cool, let us know how that works. I can't remember if we've tried something similar. From the pelias/schema directory, you can run this to reset the schema: WARNING: This will remove all the data you've imported into the pelias index in Elasticsearch, and then you'll have to re-index it.
|
It worked. Now it treats NH-14 as NH14. One more thing "peliasIndexOneEdgeGram" : {
"type": "custom",
"tokenizer" : "peliasNameTokenizer",
"char_filter" : ["punctuation","specialChar"],
"filter": [
"lowercase",
"asciifolding",
"trim",
"full_token_address_suffix_expansion",
"ampersand",
"remove_ordinals",
"removeAllZeroNumericPrefix",
"peliasOneEdgeGramFilter",
"unique",
"notnull"
]
}, "char_filter": {
"punctuation" : {
"type" : "mapping",
"mappings" : punctuation.blacklist.map(function(c){
return c + '=>';
})
},
"alphanumeric" : {
"type" : "pattern_replace",
"pattern": "[^a-zA-Z0-9]",
"replacement": ""
},
"numeric" : {
"type" : "pattern_replace",
"pattern": "[^0-9]",
"replacement": " "
},
"specialChar" : {
"type":"pattern_replace",
"pattern":"NH\\s*",
"replacement":"NH"
}
}
}, i checked by adding test in analyzer_peliasIndexOneEdgeGram.js. |
Hey @mohitgoyal201617, I'm glad adding handling for the @mohitgoyal201617 Your changes as posted in your comment are (obviously) a bit too specific to be merged, but we would gladly help you create a pull request against pelias/schema that works across more cases. We can also help you figure out why the scoring isn't as you expect. Our gitter chat room might be a better place than Github comments, let me know. |
hi @mohitgoyal201617 I'm assuming you're referring to "National Highway No. 14 Route: Radhanpur to Beawar" (India)? there are two ways of handling it, you can either
it looks like you're using Looking at your replacement function it doesn't seem to be correct, I'm surprised it's working for you.
The way I read this regex it says "anything starting with NH followed by zero or more whitespace characters should be replaced with the text "NH". Don't you want something like this?
... which says "anything starting with "nh", followed by a "-" and then two digits is replaced with "nh" followed by the digits"? note: I would suggest changing it from a
The note: the tokens should be lowercased by this point. |
yes ,, right On Tue, Jun 14, 2016 at 9:09 PM, Peter Johnson a.k.a. insertcoffee <
Mohit Goyal |
You are totally right. AddressIt is not very flexible globally. Fortunately we have work ongoing to use libpostal, a machine learning project to do address parsing globally trained on OSM data. @trescube is working on integrating it into Pelias right now, and I believe initial versions for testing will be available soon. |
I have inserted some openaddress, When I search NH-11 it gives me result but when i search NH 11 it does not give me result.
this text it present in street.
The text was updated successfully, but these errors were encountered: