Vague Searches

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Vague Searches

Jason-4
I'm trying to figure out the best approach to handling a "vague"
search.  Say I have a document with a string attribute '123 Main St,
Boston, MA, 02118' I'd like to be able to search for it using '123
Main Boston' and 'Main St, 02118', etc.  I've run into issues with
both Text and Terms searches in that there are too many matches on
'Boston' or '02118'.  I have indexes on the address parts (number,
street, town, state, zip), but using Or or Should, I run into the same
problem, too many results.  Is there a way to boost the number and
address as part of an Or Terms match?
Reply | Threaded
Open this post in threaded view
|

Re: Vague Searches

Jan Fiedler
For searches on the full address field I'd recommend setting the operator of the text query to 'and'. This should make sure all the terms the user entered are (somehow) part of the indexed address. This approach will provide no results if the user entered terms that are not part of the address. In such a case you could fallback to an 'or' text search.
Reply | Threaded
Open this post in threaded view
|

Re: Vague Searches

Karussell
In reply to this post by Jason-4
Probably with a combination of this:

http://www.elasticsearch.org/guide/reference/query-dsl/custom-filters-score-query.html

and boosting while indexing you can reach your goal (?)

Peter.

On 19 Jan., 23:06, Jason <[hidden email]> wrote:
> I'm trying to figure out the best approach to handling a "vague"
> search.  Say I have a document with a string attribute '123 Main St,
> Boston, MA, 02118' I'd like to be able to search for it using '123
> Main Boston' and 'Main St, 02118', etc.  I've run into issues with
> both Text and Terms searches in that there are too many matches on
> 'Boston' or '02118'.  I have indexes on the address parts (number,
> street, town, state, zip), but using Or or Should, I run into the same
> problem, too many results.  Is there a way to boost the number and
> address as part of an Or Terms match?
Reply | Threaded
Open this post in threaded view
|

Re: Vague Searches

kimchy
Administrator
Another option is to use the more like this query.

On Sat, Jan 21, 2012 at 10:49 PM, Karussell <[hidden email]> wrote:
Probably with a combination of this:

http://www.elasticsearch.org/guide/reference/query-dsl/custom-filters-score-query.html

and boosting while indexing you can reach your goal (?)

Peter.

On 19 Jan., 23:06, Jason <[hidden email]> wrote:
> I'm trying to figure out the best approach to handling a "vague"
> search.  Say I have a document with a string attribute '123 Main St,
> Boston, MA, 02118' I'd like to be able to search for it using '123
> Main Boston' and 'Main St, 02118', etc.  I've run into issues with
> both Text and Terms searches in that there are too many matches on
> 'Boston' or '02118'.  I have indexes on the address parts (number,
> street, town, state, zip), but using Or or Should, I run into the same
> problem, too many results.  Is there a way to boost the number and
> address as part of an Or Terms match?