Lucene query on fields: how to search the beginning only
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2009 11:08 AM
Hello,
I have a document which has an attribute which could contains "A B C",
another one could contains "B C A".
Which syntax do I have to use to search with Lucene to get the first one, values starting with "A".
I tried to use @attribute:A[^] (found on http://wiki.alfresco.com/wiki/Review_Of_Full_Text_Search_Query_Syntax (further extensions: so when could we use this ?)).
Greetings
I have a document which has an attribute which could contains "A B C",
another one could contains "B C A".
Which syntax do I have to use to search with Lucene to get the first one, values starting with "A".
I tried to use @attribute:A[^] (found on http://wiki.alfresco.com/wiki/Review_Of_Full_Text_Search_Query_Syntax (further extensions: so when could we use this ?)).
Greetings
Labels:
- Labels:
-
Archive
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2009 04:36 AM
Hi
It is not so easy.
The best approach is to use dual tokenisation which will ba available in 3.2, or not to tokenise the property.
Then use Alfresco FTS to do a pattern search "A*"
Andy
It is not so easy.
The best approach is to use dual tokenisation which will ba available in 3.2, or not to tokenise the property.
Then use Alfresco FTS to do a pattern search "A*"
Andy
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2009 04:50 AM
Thanks for your reply. By the way we have changed the analyzer for some of our properties, they are not tokenized or transformed for instance (from "A B C" to "A_B_C", or anything else which is not a stop word), and now we could search and find what we needed to.
Greetings,
Alain
Greetings,
Alain
