Gabriel Nascimento
Gabriel Nascimento

Reputation: 13

Regex query in solr

I'm trying to make a regex query in solr using lookahead to match terms in any order. It's not working.

I'm doing the following query:

q=(itemKeyword:/(?=.*REDE).*(?=.*ENLACE).*/)

To get the document containing:

"INTERFACE GERENCIAMENTO RADIO ENLACE - APLICACAO: MICROONDAS, TIPO ACESSO: REMOTO TELEACIONAMENTO, ARMAZENAMENTO DADOS: HD, CANAL SERVICO: N/A, MONITOR: N/A, FUNCAO: GERENCIAMENTO DE REDE"

Upvotes: 1

Views: 1862

Answers (1)

Wiktor Stribiżew
Wiktor Stribiżew

Reputation: 626804

You may use the & operator:

itemKeyword:/.*REDE.*&.*ENLACE.*/

The pattern matches a string that contains both REDE and ENLACE.

Upvotes: 1

Related Questions