cancel
Showing results for 
Search instead for 
Did you mean: 

Lucene query problem

rutaveejshah
Champ in-the-making
Champ in-the-making
Hi
I want to write a lucene query using which i can search the user by their jobtitle and location.
I write the lucene query for that but it is not working.
I check that query on node browser but still it gives me an error.
Please anybody have some solution on that.

My lucene query is like this
@cm\\:jobtitle:\"SE" and @cm\\:location:\"india"

Is there any error in above query than also let me know?

Thank You.


1 REPLY 1

rjohnson
Star Contributor
Star Contributor
I suspect that your problem is the escaping.

In the node browser you would type

@cm\:jobtitle:"SE" and @cm\:location:"india"


in the text box, select lucence as a languase and click search. That shoud work. Note only one \ before one : in each phrase.

If you want to put your query in a string in a javasript you will need to do


var query = '@cm\\:jobtitle:"SE" and @cm\\:location:"india"';
var def = {
query: query
};
var results = search.query(def);


Bob