I really need ypur help to my thesis. More_like_this and fields

I am using the More_like_this query for getting the similarity between medical reports and then put them in a matrix for a university work. The problem is that somehow it is only giving me 10 results instead of all of them. I guess it is giving me the 10 more similar? but why?

we have tried putting a size field and nothing is working. Also is there a way to show the results divided by the fields? because i have read the query mixes all the fields results to give a final score, but i would also like to get the individual scores to make an exhaustive analysis. I hope you can help me. I can't find a lot of information and we haven't studied the technology, we are doing it on our own. Thank you very very much. this is my code:

def search_similar (self, id_caso):
return self._es_buscar({ "size": 100, "query": { "more_like_this": {
    "like": [ { "_id": id_caso} ],
    "fields": self.conf.get('campos'),
    "max_query_terms": 100,
    "min_term_freq": 0,
    "minimum_should_match": 0
} } })

def _es_buscar (self, query):
res = self._es.search(index="historiales",
                      doc_type="historial",
                      body=query)
return [{ 'id': r['_id'], 'doc': r['_source'], 'score' : r['_score']}
        for r in res['hits']['hits']]

Your query seems to be fine. Try to run it manually against the cluster.

curl -XPOST localhost:9200/historiales/_search -H 'Content-Type: application/json' -d '
{
"size": 100,
"query": {
"more_like_this": {
"like": [
{
"_id": "I-UKDWsBYyzZb1nReo3f"
}
],
"fields": ["pname"],
"max_query_terms": 100,
"min_term_freq": 0,
"minimum_should_match": 0
}
}
}'

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.