These are chat archives for aparo/pyes

1st
Oct 2015
patilvikram
@patilvikram
Oct 01 2015 06:41
hi
Alberto Paro
@aparo
Oct 01 2015 06:42
hi
patilvikram
@patilvikram
Oct 01 2015 06:42
I have just started using pyes for Elasticsearch
Alberto Paro
@aparo
Oct 01 2015 06:42
do you need some help?
patilvikram
@patilvikram
Oct 01 2015 06:42
I would like to contribute as well
yes I do
I am looking for BoostingQuery implementation but I could not find one
hey albert
are you there?
Alberto Paro
@aparo
Oct 01 2015 06:52
Perhaps I did not implemented it.
I'm in car
patilvikram
@patilvikram
Oct 01 2015 06:54
sorry will ping you later
Alberto Paro
@aparo
Oct 01 2015 06:56
give me 15 minutes
patilvikram
@patilvikram
Oct 01 2015 06:57
sure
Alberto Paro
@aparo
Oct 01 2015 07:16
ok
The boot query is missing
to implement a new query, its quite simple
if you look to query.py
you need the property of the new query and write a serialize method for the query
for example look at :
class FuzzyQuery(Query):
    """
    A fuzzy based query that uses similarity based on Levenshtein (edit distance) algorithm.
    Note
        Warning: this query is not very scalable with its default prefix
        length of 0 - in this case, every term will be enumerated and cause an
        edit score calculation. Here is a simple example:
    """

    _internal_name = "fuzzy"

    def __init__(self, field, value, boost=None, min_similarity=0.5,
                 prefix_length=0, **kwargs):
        super(FuzzyQuery, self).__init__(**kwargs)
        self.field = field
        self.value = value
        self.boost = boost
        self.min_similarity = min_similarity
        self.prefix_length = prefix_length

    def _serialize(self):
        data = {
            'value': self.value,
            'min_similarity': self.min_similarity,
            'prefix_length': self.prefix_length,
            }
        if self.boost:
            data['boost'] = self.boost
        return {self.field: data}
patilvikram
@patilvikram
Oct 01 2015 07:31
cool thanks
I was looking for booting query but I will try to implement in next few days
boosting*
Alberto Paro
@aparo
Oct 01 2015 08:26
I'll implement for you in 15 minutes
let me finish updating macosx
Alberto Paro
@aparo
Oct 01 2015 08:49
ok pushed boostingquery in master
patilvikram
@patilvikram
Oct 01 2015 09:01
thanks