cancel
Showing results for 
Search instead for 
Did you mean: 

Search for property values

buurd
Champ in-the-making
Champ in-the-making
Hi!

I'm trying to search for property values (not content) using javascript. Is it possible?

The usecase is a searchform where the values of dropdowns should be filled with actual values used for that property. As far as I can se right now it is only possible to find content (eg documents and spaces).

Thanks in advance
Roland
2 REPLIES 2

billerby
Champ on-the-rise
Champ on-the-rise
That should be no problem at all since the javascript api supports all kinds of searches. You just have to construct an appropriate query. For example a lucene query with the keyword ALL:"dog" will find all nodes with metadata properties containing the word "dog".

/Erik

buurd
Champ in-the-making
Champ in-the-making
The problem is that the query you described will return ScriptNodes, not a list of metadata-values. That means that if I ask for all people that have created a document (cm:creator) I will get all documents in the system instead of the 100 authors.

Right now I loop trough the thousands of hits and add the authors in a hashmap to remove the duplicates and get the list of authors. But it is very slow an will only get slower the more documents I get into the system. Imagine a system with a couple of millions of documents and have to read the properties of every document to get the information you want.

Thanks in advance
Roland