Lucene query with property value

cancel
Showing results for 
Search instead for 
Did you mean: 
gabrielmacerot
Member II

Lucene query with property value

I need to query lucene with this: @ph\:siren:"666999666" AND @ph\:cinematique:"pdf-v"

When I do this in the node browser I obtain uncorresponding results. No problem with the siren property but it seems like the query match everything containing pdf (despite of the '-v'). I want to query everything that matchs exactly "pdf-v".

Any help?

6 Replies
afaust
Master

Re: Lucene query with property value

For exact matches you must adapt the query accordingly, otherwise stemming / partial matching may occur.

Also, do not use Lucene queries anymore. The Lucene query language is a legacy search language within Alfresco and does not benefit from all the improvements that Alfresco adds to make searches more efficient (e.g. transactional metadata queries).

The proper Alfresco FTS query to look for exact matches is:

=ph:siren:"666999666" AND =ph:cinematique:"pdf-v"
gabrielmacerot
Member II

Re: Lucene query with property value

Thanks.

It makes a long time we hesitate to suppress Lucene. But it's a really important part of our application and I must find examples and prove it can work.

So I try your query in the node browser and it seems that something went wrong:

Search failed due to: org.alfresco.repo.search.impl.parsers.FTSQueryException: 02280007 line 1:10 mismatched input '"666999666"' expecting set null [ftsQuery, ftsDisjunction, ftsImplicitDisjunction, ftsExplicitConjunction, ftsPrefixed, ftsTest, ftsExactTerm, ftsTerm, ftsWord]

I try without the double quote and it's worse thant when I used (1000 values instead of the 93 wrong values ).

If I escape the minus in pdf-v, I have back my 93 wrong values....

It seems like the equal is completely ignore or with no effect???

afaust
Master

Re: Lucene query with property value

What version of Alfresco are you using? And to make sure, what language did you select in the Node Browser? The double quotes are definitely needed and I did not say anything about removing them.

gabrielmacerot
Member II

Re: Lucene query with property value

We are using Alfresco 3.4d (We are working in order to integrate our application in Alfresco 4)
I choose fts-alfresco. And I know that you say nothing about removing them, I'd just try to adapt the query since I saw Exception.

gabrielmacerot
Member II

Re: Lucene query with property value

Still having the problem. Impossible to run your FTS query in the nodebrowser ...

afaust
Master

Re: Lucene query with property value

Try running it as the following query. Though FTS should technically not require the escaping, maybe were some issues in the 3.4 version with regards to query parsing and translating it into Lucene...

=ph\:siren:"666999666" AND =ph\:cinematique:"pdf-v"