cancel
Showing results for 
Search instead for 
Did you mean: 

Full-Text Search not working.

beslan
Champ in-the-making
Champ in-the-making
Hi,

I am using Alfresco 4.2.b with Java foundation api in my app.

I am adding a text content to repository and query it with lucene. I can't find the content.
If I add the content from alfresco web client same query is working.

My lucene is like ALL:MYCONTENT.

My issue is similar with  https://forums.alfresco.com/en/viewtopic.php?f=4&t=37137&hilit=lucene but it is not solved either.

Thanks.
1 REPLY 1

beslan
Champ in-the-making
Champ in-the-making
Hi,

I have solved the problem. It is simple but hard to find.

If mimetype of content is null then full text search is not working.

      ContentService contentService = this.getServiceRegistry().getContentService();
      ContentWriter writer = contentService.getWriter(contentNodeRef, ContentModel.PROP_CONTENT, true);
      writer.setMimetype(content.getMimeType()); //This was null for me.
      writer.setEncoding("UTF-8");
      writer.putContent(new ByteArrayInputStream(contentBuffer));