The Query return only 10 item


(mabrouk) #1

Hello everyone
I wrote this code for common data in elastic search, but I found that 10 line

Var hits = _context.Search (new search ()
{
Query = new Query (new MatchAllQuery ())
}, New SearchUrlParameters {Pretty = true});

#endregion
#region search2
Var hits1 = _context.Search (new search ()
{
Query = new Query (new MatchAllQuery ())
}, New SearchUrlParameters {Pretty = true});
List listl = new List ();
Foreach (var element in hits1.PayloadResult.Hits.HitsResult)
{
Foreach (var hit hits.PayloadResult.Hits.HitsResult)
{
If ((item.Source.idu! = Null) && (hit.Source.uid! = Null))
{
Console.WriteLine (item.Source.idu);
Console.WriteLine (hit.Source.uid);
If (item.Source.idu == hit.Source.uid)
{
If (hit.Source.email.Contains (searchTerm) ||
Hit.Source.last_name.Contains (searchTerm) ||
Hit.Source.first_name.Contains (searchTerm) ||
Item.Source.address.Contains (searchTerm) ||
Item.Source.societe.Contains (searchTerm)
)
{
Listl.Add (hit.Source.first_name + "" + hit.Source.last_name + "" + item.Source.address + "" + item.Source.societe + "" + hit.Source.email);
}
}
}

}


(Mark Walkom) #2

See https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-request-from-size.html for what is happening here and how to fix it :slight_smile:


(mabrouk) #3

But I think that this method hits1.PayloadResult.Hits.HitsResult returns only 10 elements


(system) #4

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