cancel
Showing results for 
Search instead for 
Did you mean: 

Exact lucene search in alfresco

mrinal3199
Champ in-the-making
Champ in-the-making
Hi All,

     I have one requirement for searching for the exact phrase for a content field in share using lucene search. Can any one help me out in this. For example: If i am searching for "Test" phrase in any of the particular field of a content. It should return only those noderefs which are having exactly "Test" phrase(case insesitive can be taken) in their content field not those which cntains this phrase and have other words also.

Please help me out. Waiting for the replies..



Thanks,
Mrinal Kumar
5 REPLIES 5

yogeshpj
Star Contributor
Star Contributor

mrinal3199
Champ in-the-making
Champ in-the-making
HI Yogesh,

       Thanks for the reply. Actually i don,t want to change the settings of my model or even standard anlyzer to keyword anlyzer. Is there any way to do it just through lucene search query. Because i wil need some where exact term search and somewhere as full text search also.\

Thanks,

yogeshpj
Star Contributor
Star Contributor
I dont think so using only lucene you can do that.

mrinal3199
Champ in-the-making
Champ in-the-making
Hi Yogesh,
   Here is the alternative which i want for the same purpose as you said with lucene query i can not achieve that. it might not be a alfresco solution but as i have to do it in alfresco, so, i am posting it here. My main problem is that I am retrieving a property(content field) value of a content from alfresco which may have html tags appended to them. I am retrieving it using content reader in java. And so, i am getting the content value along with html tags appended to it. Can any one please suggest me a way to remove all html tags and to get just the content part of that. For example: if a content value i am getting as "Test" which is appended with some html tags say p tag or ul tag etc., i want to get only "Test" from it. There may be other html tags even appended to it which is limitless.

Thanks,
Mrinal

yogeshpj
Star Contributor
Star Contributor
I am not able to understand how it is alternative approach for your problem.

Anyways for removing html tags from content, you can convert it in to string and from string you can easily remove html tags using regular expression.