Elastic Search Queries : Searching in Nested Array of Documents and Filtering Q by Keval Jain

Elastic Search Queries : Searching in Nested Array of Documents and Filtering Q by Keval Jain

Soumil Shah

3 года назад

14,993 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Harkiran Kaur
Harkiran Kaur - 14.05.2023 00:19

Hi Soumil, i have one pattern in which i need to search for a specific number. I am using must but even after using must i am getting results other than the query mentioned as well. Is there a way i can just create a query to find the number which i mentioned and not to show any result related to other numbers

Ответить
Ayush Mathur
Ayush Mathur - 13.01.2023 16:46

What if I know the root/ parent object but not sure about the absolute hierarchy of the value I'm looking for ? For instance, {name: ABC, kids_count: 2, kids: [ {name: AS, kids_count: 1, kids: [{name: JJ, kids_count: 0, kids: [{}] }], {name: XYZ, kids_count: 1, kids: [{name: FOF, kids_count: 0, kids: [{}] }] } ] } and I need to search for a kid with name "FOF" but I'm not sure under which hierarchy he/she would be.

Ответить
Amit Gujar
Amit Gujar - 05.09.2022 21:41

Plz do some facet search

Ответить
5 Minute Tuition
5 Minute Tuition - 12.07.2022 06:48

HI Soumil, Can you help me that...how can we write complex query like below in elastic

select distinct t1.referenceno, t2.processstate, t1.processtimestamp from ((SELECT referenceno, MAX(dashboard) AS dashboard, MAX(channel) AS channel, MAX(sequence) AS sequence, MAX(pstr0) AS pstr0, MAX(pstr1) AS pstr1,
MAX(pstr2) AS pstr2, MAX(pstr3) AS pstr3, MAX(pstr4) AS pstr4, MAX(pstr5) AS pstr5, MAX(pstr6) AS pstr6, MAX(pstr7) AS pstr7, MAX(pstr8) AS pstr8, MAX(pstr9) AS pstr9, MAX(pstr10) AS pstr10, MAX(pstr11) AS pstr11, MAX(processtimestamp) AS processtimestamp FROM pmc_temp where processtimestamp IN (select max(processtimestamp) from pmc_temp group by referenceno) GROUP BY referenceno) t1 inner join (select referenceno, processstate from pmc_temp where processtimestamp in (select max(processtimestamp) from pmc_temp group by referenceno) and referenceno
in (select referenceno from pmc_temp group by referenceno)) t2 on t1.referenceno = t2.referenceno);

Thanks in Advance🙂

Ответить
Rahul Prajapati
Rahul Prajapati - 06.06.2022 07:30

Hi Soumil, I want to do something like this during update documents. Let's say I have below record in ES,
{
"id": "1",
"student_name": "Rahul",
"books": [
{
"book_id": "11",
"book_name": "History",
"status": "Started"
}
]
}
Now let's say I have received another json to process I need to update the existing document if id is same or just insert it. If I receive below json,
{
"id": "1",
"address": "Bangalore",
"books": [
{
"book_id": "11",
"book_name": "History",
"status": "Finished"
},
{
"book_id": "12",
"book_name": "History",
"status": "Started"
}
]
}
I want to have my final document like below:
{
"id": "1",
"student_name": "Rahul",
"address": "Bangalore",
"books": [
{
"book_id": "11",
"book_name": "History",
"status": "Finished"
},
{
"book_id": "12",
"book_name": "History",
"status": "Started"
}
]
}

I wan to understand whether is it possible to via es queries if yes then want to know the way how to achieve it. Merging at application level and override I can think one way. Please suggest and thanks in advance.

Ответить
Mohamed Naufal
Mohamed Naufal - 02.06.2022 10:15

Hi, I've been following your videos, and I'm stuck with a scenario. We get the data from AWS data streams, continuously. So, whenever I search for records, I get the throughout list, instead of getting only the latest records. Can you help me get only the latest records instead of getting them all?

Ответить
sats ph
sats ph - 18.03.2022 08:05

How can we make filter in first index of array only

Ответить
Abhishek Sen
Abhishek Sen - 15.01.2022 00:44

Other countries don't have background noise or what :D :D

Ответить
Mr.Kristian252
Mr.Kristian252 - 16.09.2021 23:51

I recommend you do some cutting next time.
I see this was live, was it? Then I understand.
Interresting

Ответить
Hiếu Minh
Hiếu Minh - 26.08.2021 07:00

How can I search by "group"? help me answer!!! please !!

Ответить
UFO Luxury
UFO Luxury - 29.07.2021 09:33

HI @Somil can you let me know how to do use elastic search template

Ответить
Jonh Rod
Jonh Rod - 08.07.2021 04:10

How to determine the Size? As current default on replay is 10 docs?

Ответить
Little Simba
Little Simba - 14.06.2021 13:30

Hi Soumil, Is it possible to get the count of all the documents in the inner_hits?

Ответить
monisha ranjan
monisha ranjan - 08.05.2021 19:02

Hi @somil can you tell more about how foreign key system works in case of elastic search.

Ответить
Kapil Pachori
Kapil Pachori - 24.01.2021 22:36

How to put ..And(must) condition with 2 index

Ответить
Programmer-RD-AI
Programmer-RD-AI - 11.11.2020 16:15

Can you please do a Q and A soon please.

Ответить