cancel
Showing results for 
Search instead for 
Did you mean: 

Lucene: wrong result!

oscareng
Champ in-the-making
Champ in-the-making
Hi guys,
I use Alfresco from a remote application connected by web services. I created a customized data model (extending the "content" type) and, after some hours/days of normal operations (documents loading and metadata uploading), I had some trouble with the searching using Lucene queries: it happens that not all the documents that are compliant with the search parameters are found. If I try to restart Alfresco with the forced indexing, everything come back to normality and the searching with Lucene works properly. How can I avoid to restart Alfresco to perform a new indexing? Does anyone know why this happen?

Thanks
4 REPLIES 4

mrogers
Star Contributor
Star Contributor
Could you clarify your posting please.   In particular are you saying that Lucene has gone wrong or are you saying that you now have consistency problems after changing your custom model.   

And how many documents have you loaded?

May also be worth giving an example of the query that you are running.

And finally are there any errors in your alfresco.log?

oscareng
Champ in-the-making
Champ in-the-making
First af all we import about 1500 documents on Alfresco with a massive operation. After that, an external remote application, using our customized web services, can load new documents or update document metadatas. For out research, Lucene works properly but, sometime it happens that a research do not produce the right results. An example follows:

dataModel.xml
(it's an example, my model is built with about 30 properties)

<?xml version="1.0" encoding="UTF-8"?>

<model name="sc:examplemodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!– Optional metadata about the model –>
<description>Example Model</description>
<author>User</author>
<version>1.0</version>
<!– Imports are required to allow references to definitions in other models –>
<imports>
  <!– Import Alfresco Dictionary Definitions –>
  <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
  <!– Import Alfresco Content Domain Model Definitions –>
  <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
</imports>
<!– Introduction of new namespaces defined by this model –>
<namespaces>
  <namespace uri="example.model" prefix="sc"/>
</namespaces>
<!– Type and Aspect definitions go here –>
<types>
  <type name="sc:generalmodel">
   <title>General Model</title>
   <parent>cm:content</parent>
   <properties>
  
    <property name="sc:meta1">
     <type>d:text</type>
     <mandatory>false</mandatory>
    </property>
   
   </properties>
  </type>
</types>
</model>

My space organization:

Company Home
- root
  – leaf1
     — doc1 (meta1="metadata")
     — doc2 (meta1="xxx")
     — doc3 (meta1="xxx")
     — doc4 (meta1="xxx")
  – leaf2
    — doc5 (meta1="metadata")
    — doc6 (meta1="xxx")
    — doc7 (meta1="xxx")
    — doc8 (meta1="xxx")

I put 4 documents (doc9, doc10,doc11, doc12) into the root/leaf3 space
Space become:

Company Home:
- root
  – leaf1
     — doc1 (meta1="metadata")
     — doc2 (meta1="xxx")
     — doc3 (meta1="xxx")
     — doc4 (meta1="xxx")
  – leaf2
    — doc5 (meta1="metadata")
    — doc6 (meta1="xxx")
    — doc7 (meta1="xxx")
    — doc8 (meta1="xxx")
  – leaf3
    — doc9 (meta1="metadata")
    — doc10 (meta1="xxx")
    — doc11 (meta1="xxx")
    — doc12 (meta1="xxx")

If I execute a Lucene query like:
PATH: "/app:company_home/cm:root/cm:leaf3//*"
result= 4 documents:doc9, doc10, doc11, doc12 - - - IT WORKS EVERY TIME

If I add some constrains of customized metadatas:
PATH: "/app:company_home/cm:root//*" AND @sc\:meta1:"metadata"
result= 2 documents: doc1,doc5 — doc9 MISSED, SOMETIME THE RESULT IS WRONG (AND IT STAYS WRONG UNTIL I RESTART ALFRESCO)

If I restart Aldresco forcing the FULL indexing (index.recovery.mode=FULL), executingt the same query:
PATH: "/app:company_home/cm:root//*" AND @sc\:meta1:"metadata"
result= 3 documents: doc1,doc5, doc9 — CORRECT

andy
Champ on-the-rise
Champ on-the-rise
Hi

How do you add the meta-data to the document?

Andy

oscareng
Champ in-the-making
Champ in-the-making
Of course!
Every documents are filled with metadata when are updated on Alfresco.

Thanks for reply.
Oscar