How Flexmonster read data from elasticsearch?

Answered
Stefano asked on May 2, 2024

I'm using Flexmonster to connect to my local elasticsearch indices, but would like to know how that happens. In particular I don't understand how it can load all the data and not just the first 10k records as an usual "http://localhost:9200/index/_search?size=10000" would work.

When I run a query (a simple count on a field just to know how many records it reads) there are two network requests (look the 2 attached screenshot).

 

Both of them use URL: "http://localhost:9200/jolanda_map/_search" and retrive all the dataset because the query shows me the exact number of records (2.7 millions).

So:

  • Why if I use that same URL i just get the first 10 records?
  • Why there are two requests (one with "OPTIONS" method, and one with "POST" method)?
  • If I would replicate what Fleximonster does, getting all record in my dataset (rather than first 10 or 10k), how could I do?

 

Attachments:
search1
search2

3 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster May 3, 2024

Hello, Stefano!

Thank you for reaching out to us.

It sounds like you are diving deep into how Flexmonster integrates with Elasticsearch.To better assist you, could you please provide a bit more context about your use case? Knowing more about how you are currently integrating Flexmonster with your Elasticsearch instance would greatly help us to provide a more accurate response.
Also, you may check our blog post for more information about how Flexmonster interacts with Elasticsearch data sources: https://www.flexmonster.com/blog/introducing-flexmonster-pivot-for-elasticsearch/ 

Looking forward to hearing from you.

Best Regards,
Maksym

Public
Stefano May 6, 2024

Hello Maksym,

 

thanks for your answer. 

 

To be honest, I do have not a given use case, I just would like to understand how to work with Elasticsearch. The idea is that if I don't know how to do something, I try to look at what others do to learn.

 

In this case, I'm interested in reading all the records in an index by URL request, but I'm not able to do it for more than 10k records just using only "/_search". Flexmonster can read all the data in the index so I asked myself how it could happen and I noticed that it just uses "/_search". My question was then: "Why when I use the same URL doesn't work at all?".

 

I think I could have an answer now, but not sure yet. It seems there is a difference between the URL request I do using my browser and the request made by Flexmonster that uses REST API. Is it right?

 

Stefano

Public
Maksym Diachenko Maksym Diachenko Flexmonster May 8, 2024

Hello, Stefano!

Thank you for your reply.

After reviewing your inquiries, they seem more closely related to Elasticsearch functionalities than Flexmonster itself. While we are always eager to assist our users with Flexmonster, in this case, we believe you would find the most accurate and comprehensive answers by consulting the Elasticsearch documentation or reaching out to their support team directly.

Best Regards,
Maksym

Please login or Register to Submit Answer