Need help to write fast query

Hi all,
Consider, I have 1000phrases(Example of phrases can be: 1. "Hello",2. "What are you doing", 3. "automatically debit",...etc) as a1, a2, a3.......a1000. now I need to write a query in java for the ES database, the query should replicate the below:
There is a main base phrase, which I need to include with all other 1000 phrases while querying, for example:
consider the base phrase as A. now my query should replicate as:
A and a1,
A and a2,
A and a3,
A and a1000
} whole comes within one query. i have around 10,00,000 documents. i wrote a query but its taking very long time. appropriately more than 40seconds.
Anyone could help me?

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