• Question about fulltext search

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #902  by Field888
 
Hi
I learn that the search statements in OpenKM are organized like this:
//element(*,okm:document)[jcr:contains(.,\'term1\') and jcr:contains(.,\'term2\')]
but how do you search for content that does not include a term? Is it using jcr:contains(.,\'-term1\')? I tests this statment but doesn\'t work.

I appreciate any help
 #906  by pavila
 
OpenKM uses Lucene for queries. See Lucene Query Syntax to learn more on its capabilities. And your query should be re-written this way:
Code: Select all
//element(*,okm:document)[jcr:contains(okm:content,\'term1\') and jcr:contains(okm:content,\'term2\')]
 #907  by pavila
 
See this query:
Code: Select all
/jcr:root/okm:root//element(*,okm:document)[jcr:contains(okm:content,\'coche -casa\')] order by @jcr:score descending
This will search for documents which contains \"coche\" and not \"casa\", and will order the results.
 #908  by Field888
 
Thanks for your help,
I organized the querry like this:
/jcr:root/okm:root//element(*,okm:document)[jcr:contains(okm:content,\'* - casa\')] order by @jcr:score descending

And this works well. :)

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.