Modeshape get queryResult repository and Indexing
fazileh Oct 26, 2013 6:52 AMI 'm using modeshape-3.4.0.Final on my application that installed on a server desktop pc, and many clients connect to that. In my code, Before I had use path (/users/nodes) for get nodes, but now I want to run a query on existing nodes. It's a simple query, but It does not have any result in run mode, While the in debug mode has the expected result. I searched a lot and I found this post: Re: Querying a repository and this quotes:
One quirk of ModeShape is that, upon the first startup, index the entire repository content so that searching and queries will work. If there is already content (e.g., existing files on the file system used by your file system connector), then this may take a while, depending upon the size of the content. If you are submitting your queries before this indexing finishes (or even before the first batch of indexing completes), there will be nothing in the indexes and thus nothing in the results.
I tried a wait(30000) in my code, and result fetch correctly.If I'm not mistaken, I guess my problem is INDEXING.
I don't have any setting for indexing in my json file. my repository json file is:
{
"name" : "MyRepository",
"transactionMode" : "auto",
"monitoring" : {
"enabled" : true,
},
"workspaces" : {
"predefined" : ["otherWorkspace"],
"default" : "my_wsp",
"allowCreation" : true
},
"security" : {
"anonymous" : {
"roles" : ["readonly","readwrite","admin"],
"useOnFailedLogin" : false
}
},
"storage" : {
"cacheName" : "MyRepository",
"cacheConfiguration" : "${user.home}/.MyRep/infinispan_configuration.xml",
"binaryStorage" : {
"type" : "file",
"directory" : "${user.home}/MyStorage/MyRepository",
"minimumBinarySizeInBytes" : 4096
}
}
}
I want to know Do I have to add "query":{} part to my json file? like this:
"query"
: {
"enabled"
:
true
,
"indexStorage"
: {
"type"
:
"filesystem"
,
"location"
:
"/path/on/filesystem"
,
"lockingStrategy"
:
"simple"
,
"fileSystemAccessType"
:
"auto"
},
"indexing"
: {
"rebuildOnStartup"
: {
"when"
:
"if_missing"
,
"includeSystemContent"
:
true
,
"mode"
: async
},
"threadPool"
:
"modeshape-workers"
,
"analyzer"
:
"org.apache.lucene.analysis.standard.StandardAnalyzer"
,
"similarity"
:
"org.apache.lucene.search.DefaultSimilarity"
,
"indexFormat"
:
"LUCENE_CURRENT"
,
"readerStrategy"
:
"shared"
,
"backend"
: {
"type"
:
"lucene"
},
"batchSize"
: -
1
,
"mode"
:
"sync"
,
"asyncThreadPoolSize"
:
1
,
"asyncMaxQueueSize"
:
0
},
},
Is it enough, or I have to change current repository!?
Thanks in advance