I want to retrieve the list of folders in a specific node whose list of childrens is empty using Lucene query.
I create this query:
+PATH:"/app:company_home/cm:contexts/cm:ctx_exploitation/cm:runs/cm:Run_322645//."+Children is empty.
but it does not give good results.
What is the right Lucene syntax to do this
There is no way to find empty folders using a Lucene query.
However, there are some java services and javascript APIs in alfresco
like 'FileFolderService' in Java and 'childByNamePath' in javascript,
using them you can write your logic and find empty folders.
You can find o bytes file using below lucene query.
TYPE:"cm:content" AND #cm:content.size:0
Related
I use apache solr for my search engine. I have a schema with a field called "typology". I'd like to search inside all typologies but i need to calculate facets of many fields for only one typology. Is it possible?
Thank you
Your base query for facets does not have to be the same as your search query. facet.query parameter allows you to have a different search for that.
I would like to get all documents that contain a certain string in them, I can't seem to find a solution for it..
for example I have the following doc ids
vw_10
vw_11
bmw_12
vw_13
bmw_14
volvo_15
vw_16
how can I get allDocs with the string vw_ "in" it?
Use batch fetch API:
db.allDocs({startkey: "vm_", endkey: "vm_\ufff0"})
Note: \ufff0 is the highest Unicode character which is used as sentinel to specify ranges for ordered strings.
You can use PouchDB find plugin API which is way more sophisticated than allDocs IMO for querying. With the PouchDB find plugin, there is a regex search operator which will allow you do exactly this.
db.find({selector: {name: {$regext: '/vw_'}}});
It's in BETA at the time of writing but we are about to ship a production app with it. That's how stable it has been so far. See https://github.com/nolanlawson/pouchdb-find for more on Pouch Db Find
You better have a view with the key you want to search. This ensures that the key is indexed. Otherwise, the search might be too slow.
I am using solr for indexing some documents and then searching. I want to return those documents that have the same start as the search keywords higher in the results. How can i achieve that?
E.g.
If i the search keyword is "php"
and there are two documents with content :
php developer
ajax php
then i want to return 'php developer' first instead of 'ajax php'.
Any suggestions on how to return results in this order?
I am looking for some sort of an analyzer that only indexes the first word from the content of a field and then giving that field a lot of weight while querying. Maybe that can help. I couldnt find such an analyzer for my purposes.
You can boost the first tokens using payload. Refer to the link mentioned in Payloads
How the search everything kind of application is indexing & keeping track of data into its search indexes.
Recently I have been working on Apache Solr which is producing amazing results for a search. But it was for one particular products catalog section that is being searched. As Solr is a stores it's data document, we indexed searchable fields as document in solr. I'm not sure how it can be used to build a search everything kind of search? And how should I index data into Solr?
By search everything I mean, to search into different module for information like Customers, Services, Accounts, Orders, Catalog, Support Ticket, etc. So search return results which is combined as a result from a single search form and user don't need to go into different forms for search that module?
Do I need to build different indexes for each such data models or store them into solr as single document? What is the best strategy to implement this.
You can store all that data in a single index with each document having an extra field that stores its type (Customer, Order, etc.). For the within-module search, just restrict the search query to documents of that type. For the Search All functionality, use copyField to copy all the relevant fields in each document type into one big field, and search with the document type field unconstrained.
I use Solr, and i would like to know if i can search over multiple index using multicore. I know there is "Distributed Search" but i think it's only for index with same schema.
Thanks.
no we can search with different schema also but only thing is it will search in common field..See this for more information .
Further for manipulation we can use solrj. else if only in solr .. read about Core Admin Handler
let me know if you need any help further.