cancel
Showing results for 
Search instead for 
Did you mean: 

lucene query strange behavior

malfresco
Champ in-the-making
Champ in-the-making
I'd appreciate if somebody can tell me why on the following alfresco repository structure
    - Company Home
      + 0
      + a
      + b
      + Data Dictionary
      + Guest Home
      + Sites
      - User Homes
        - dummy home
          + 0
          + a
          + b
        + some other home
querying these lucene queries:

@cm\:name:"0" AND PARENT:"workspace://SpacesStore/ef70afe0-a194-4a77-9fb8-616db075a500"
correctly finds 1 item

@cm\:name:"a" AND PARENT:"workspace://SpacesStore/ef70afe0-a194-4a77-9fb8-616db075a500"
DOES NOT find a … thing

@cm\:name:"b" AND PARENT:"workspace://SpacesStore/ef70afe0-a194-4a77-9fb8-616db075a500"
correctly finds 1 item

@cm\:name:"User Homes" AND PARENT:"workspace://SpacesStore/ef70afe0-a194-4a77-9fb8-616db075a500"
correctly finds 1 item

@cm\:name:"0" AND PARENT:"workspace://SpacesStore/233c8157-c501-485b-8d37-635301cd313b"
correctly finds 1 item

@cm\:name:"a" AND PARENT:"workspace://SpacesStore/233c8157-c501-485b-8d37-635301cd313b"
DOES NOT find a … thing

@cm\:name:"b" AND PARENT:"workspace://SpacesStore/233c8157-c501-485b-8d37-635301cd313b"
correctly finds 1 item

*) obviosly ef70afe0-a194-4a77-9fb8-616db075a500 is the uuid of the company home and
233c8157-c501-485b-8d37-635301cd313b id the uuid of "dummy home"

Alfresco Community (version 3.1 and 3.2)
query using .NET client  very similar with (http://forge.alfresco.com/frs/download.php/80/alfresco-dotNet-0.2Beta.zip)

Thanks in advance,
M
2 REPLIES 2

rliu
Champ in-the-making
Champ in-the-making
I would check the Lucene indexing rules. If I'm not mistaken, terms such as "a", "the", "is", "I", etc. are not written to the index. Therefore, that's why "b" shows up and "a" does not. I would try changing "a" to "aa" and see if the query works.

openpj
Elite Collaborator
Elite Collaborator
You need to use for spaces and contents a name value with at least three characters. This is a requirement of Lucene, otherwise to generate the index you need to use ISO9075 encoding.

This behaviour is needed for the root contents, in the company home space.
I have verified that for the subspaces, it works, but you need to use ISO9075 encoding.

Hope this helps.