cancel
Showing results for 
Search instead for 
Did you mean: 

search query with unexpected results

michaelp
Confirmed Champ
Confirmed Champ
Hello,

The search query
"@cm\\:name:\"*.doc\""
returns following results:

/Firmen-Home/Datenverzeichnis/Mustervorlagen für Präsentationen/doc_info.ftl
/Firmen-Home/Datenverzeichnis/Mustervorlagen für Präsentationen/my_docs_inline.ftl
/Firmen-Home/Benutzer-Homes/Alfresco Features.doc


I want to get every document with the extension '.doc' defined in the query by searching all names which ends with doc which I thought should look like "*.doc" (any name but ends with '.doc')

The documentation says:

<blockcode>To find all nodes with the cm:name property containing words ending with "ana":


@cm\:name:*ana</blockcode>


Am I missing something?

Cheers
4 REPLIES 4

afaust
Legendary Innovator
Legendary Innovator
Hello,

by putting quotation marks around the search expression *.doc you are executing a phrase query and not a direct value query. A phrase query is a bit more flexible in evaluation and can cause more matches. In this case, it will match my_docs due to prefix expansion, stemming and some character elimination, e.g. the dot in your query and the underscore in the original name are simply eliminated and the stem of docs is doc, so my_docs -> mydoc + *.doc -> *doc ==> mydoc = *doc

Try running the following query: @cm\:name:*\.doc

Regards
Axel

Hi Axel,

Thank you very much for your explanation! I could have thought of myselfe to escape the dot because the colons are also escaped Smiley Happy

Best thanks and regards,
Michael

Okay I tried it again with following queries:

query = "cm\\:name\\:\"*\\.xml\"";
query = "cm\\:name\\:\"*\.xml\"";
query = "cm\\:name\\:\".xml\"";
query = "cm\\:name\\:\"xml\"";


All searches are returning:


example test script.js.sample
folder.get.atom.ftl
blogsearch.get.atom.400.ftl
categorysearch.get.atom.404.ftl
page.component-1-1.site~swsdp~dashboard.xml
page.component-1-3.site~swsdp~dashboard.xml
page.component-2-1.site~swsdp~dashboard.xml
page.component-2-2.site~swsdp~dashboard.xml
page.component-2-3.site~swsdp~dashboard.xml
page.navigation.site~swsdp~dashboard.xml
page.title.site~swsdp~dashboard.xml
page.component-1-2.site~swsdp~dashboard.xml
page.component-1-4.site~swsdp~dashboard.xml
blogsearch.get.atom.ftl categorysearch.get.atom.ftl
page.full-width-dashlet.site~swsdp~dashboard.xml dashboard.xml
emailbody_texthtml_share.ftl
emailbody_texthtml_share_de.ftl
emailbody_texthtml_share_es.ftl
emailbody_texthtml_share_fr.ftl
emailbody_texthtml_share_it.ftl
emailbody_texthtml_share_ja.ftl
emailbody_texthtml_share_nl.ftl
emailbody_texthtml_share_ru.ftl
emailbody_texthtml_share_zh_CN.ftl
RSS_2.0_recent_docs.ftl
emailbody-texthtml.ftl
emailbody_texthtml_alfresco.ftl
emailbody_texthtml_alfresco_de.ftl
emailbody_texthtml_alfresco_es.ftl
emailbody_texthtml_alfresco_fr.ftl
emailbody_texthtml_alfresco_it.ftl
emailbody_texthtml_alfresco_nl.ftl
emailbody_texthtml_alfresco_ru.ftl
emailbody_texthtml_alfresco_zh_CN.ftl
emailbody_texthtml_alfresco_ja.ftl


Note that some results do not even contain a string "xml" ?!?

Searching with query
query = "@cm\\:name:\"*\\.doc\""
returns "doc_info.ftl" and "my_docs_inline.ftl", but not the "test1.doc" and "test2.doc" I uploaded ?!?!?

kaynezhang
World-Class Innovator
World-Class Innovator
Try

query = "@cm\\:name:*\\.doc"