Include AND OR operators in search text

I wonder if it is possible to include operators in the search text, so client can make a boolean query manually.

An example would be: "(first OR second) AND (third OR fourth)"

The following example works with query_string: "this OR another", retrieving the documents which contain one of the two words. But I don't find the way to run the first example, being able to group the words.

Is there a way to run a query with this text?

Have you looked at the query_string query? It does exactly that.

Ah!! I tried and it didn't work but now I realise it was because we where parsing some special characters because of a problem searching with wildcard ( Search problem with query_string and special characters )

I should have tested better.. Thank you so much!!