Help me with a Query pls ):

Hi evryone! am trying to do a Query to search my document. This is the document that am trying to search:

{
  "took" : 0,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : 1,
    "max_score" : 0.2876821,
    "hits" : [
      {
        "_index" : "people",
        "_type" : "user",
        "_id" : "d4f319d7-e761-4fdb-adce-889007e4e5ad",
        "_score" : 0.2876821,
        "_source" : {
          "userDates" : null,
          "admin" : false,
          "status" : false,
          "rememberMe" : false,
          "password" : null,
          "token" : null,
          "tokenExpiration" : "0001-01-01T00:00:00",
          "email" : "lorkino95@gmail.com",
          "userKnowledges" : [
            {
              "knowledgesId" : "03d7da7b-876c-42dc-84ec-a828a5795e09",
              "knowledges" : {
                "id" : "03d7da7b-876c-42dc-84ec-a828a5795e09",
                "value" : "Arquímedes",
                "explanation" : "Arquímedes es una herramienta para mediciones, presupuestos, certificaciones, pliegos de condiciones; y manual de uso y mantenimiento del edificio",
                "userKnowledges" : [ ]
              },
              "userId" : "d4f319d7-e761-4fdb-adce-889007e4e5ad"
            }
          ],
          "id" : "d4f319d7-e761-4fdb-adce-889007e4e5ad",
          "userName" : "lorkino95@gmail.com",
          "normalizedUserName" : "LORKINO95@GMAIL.COM",
          "normalizedEmail" : "LORKINO95@GMAIL.COM",
          "emailConfirmed" : true,
          "passwordHash" : "AQAAAAEAACcQAAAAENII27LAPw423GHgoTixnEeMMjUH1407mRSu3h/WQJniTrcgt670rT0OkGuMBcGq2Q==",
          "securityStamp" : "L4LFDIL5CZJBR3KOAOSMC4Z2G2TUV2TB",
          "concurrencyStamp" : "37c789fe-6c88-4362-9278-21da61f69c99",
          "phoneNumber" : null,
          "phoneNumberConfirmed" : false,
          "twoFactorEnabled" : false,
          "lockoutEnd" : null,
          "lockoutEnabled" : true,
          "accessFailedCount" : 0
        }
      }
    ]
  }
}

This is my NEST code :

var searchRequest = await MyGlobals.elasticClient.SearchAsync(s =>
** s.Qery(uq => q**
** .Term(c=>c.Field(p=>p.UserKnowledges.First().Knowledges.Value).Value("Arquímedes"))**
** ).AllTypes().Index("people"));**

And finally this the Json Qury:

GET /people/_search?
{    
"query":{"term":{"userKnowledges.knowledges.value":{
  "value":"Arquímedes"
  
  }
}
}
}

But am finding nothing ):...

Try with match instead of term.

Thx u bro!Regards from Spain!

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