How to create advance query for 'randomize' result using elasticsearch

126
February 09, 2019, at 07:30 AM

I'm having a task to create a search using elasticsearch with custom result to show. I have a table that contain many fields, but these are the important fields: merchant, name, price.

the data is like this:

id  merchant   name   price
1   abc        aqua   3.50
2   abc        lorem  1.00
...
60  abc        ipsum  1.50
61  xyz        harley 2.00
62  xyz        barley 0.50
...
115 xyz        sweet  5.60

As you can see the ordering is by id, but the data merchant is stacked, the same merchant until several rows, then go to next merchant, also stacked.

So, the task is to show the rows but in different merchant every row. for example we have 4 different merchants, so the result should be

merchant   name     price
abc        ...      ...
def        ...      ...
ghi        ...      ...
xyz        ...      ...
abc        ...      ...  -->start with abc again

start with abc again, after all merchant showed once.

I'm having little experience in elasticsearch, i've read the documentation and want to know if that can be achieved using elasticsearch

Rent Charter Buses Company
READ ALSO
WooCommerce Plugin Development: Checkout “Place order” button not working. How to fix my plugin?

WooCommerce Plugin Development: Checkout “Place order” button not working. How to fix my plugin?

I am making a WordPress Plugin that adds an option to add a custom gift voucher to the checkout pageI have managed to get the gift voucher inputs and "apply now" button working and it adds the voucher value to the checkout totals, and it adjusts the total accordingly

155
Twitter GET user_timeline Not Always Returning Count=200

Twitter GET user_timeline Not Always Returning Count=200

We are running into an issue with a small percentage of our usersWe iterate through a users tweets, making a call to user_timeline, count=200 and max_id of the previous iterations last post id

128
how to create report PDF or Excel from sever in andorid?

how to create report PDF or Excel from sever in andorid?

i want to create report pdf or excel from server data, i'm using PHP MYSQL and android, how i can create the report in android? somebody can help me to give example codes, or reference to create it?

138
create file from php unpacking file_get_contents

create file from php unpacking file_get_contents

I want am trying to create File from unpacking the same fileI am recreating this from my other function that unpacks a file stores the data in database and recreate the file again using the data

107