6140cbd632d9e5c835cb6feaf3f7f7420facbe47,datastore/elastic_search/query.py,,get_dictionary_records,#Any#Any#Any#Any#Any#,88

Before Change


    results_dictionary = {}
    results = search_results["hits"]["hits"]
    for result in results:
        results_dictionary.setdefault(result["_source"]["value"], {})
        results_dictionary[result["_source"]["value"]][result["_source"]["language_script"]] = {
            "_id": result["_id"],
            "value": result["_source"]["variants"]
        }

After Change


    }

    query_list = []
    if word_list is not None:
        word_list_chunks = [word_list[i:i + 500] for i in xrange(0, len(word_list), 500)]
        for chunk in word_list_chunks:
            updated_query = copy.deepcopy(data)
            updated_query["query"]["bool"]["must"].append({
                "terms": {
                    "value.keyword": chunk
                }
            })
            query_list.append(updated_query)
    else:
        query_list.append(data)

    results = []
    for query in query_list:
        search_kwargs = dict(kwargs, body=query, doc_type=doc_type,
                             size=ELASTICSEARCH_SEARCH_SIZE, index=index_name, scroll="1m")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: hellohaptik/chatbot_ner
Commit Name: 6140cbd632d9e5c835cb6feaf3f7f7420facbe47
Time: 2019-01-13
Author: jatin.parekh@haptik.co
File Name: datastore/elastic_search/query.py
Class Name:
Method Name: get_dictionary_records


Project Name: nilmtk/nilmtk
Commit Name: 82844481da6e1f3d391541d47af0c1466679f0f0
Time: 2014-07-11
Author: jack-list@xlk.org.uk
File Name: nilmtk/elecmeter.py
Class Name: ElecMeter
Method Name: __init__


Project Name: ncullen93/torchsample
Commit Name: ec30020ab462f652ab145bca825457fc908554c2
Time: 2017-04-18
Author: ncullen@Nicks-MacBook-Pro.local
File Name: torchsample/modules/callbacks.py
Class Name: History
Method Name: on_epoch_end