How to show more than 10 results in eXide (eXist-db)? - exist-db

I wonder how to make eXide to return more than 10 results. No matter how I query the database, it is not possible to get more. Is there some special rule in $EXIST_HOME or so?
I use eXist-db 3.0.RC1.

One way is to wrap your query in an element.
<results>{... your query here ...}</results>

Wrapping results is the way to go, but if you wish, you can edit /db/apps/eXide/resources/scripts/eXide.min.js, changing "10" in "q=n+10-1" to some other number.

Related

Xamarin UI Testing: search for elements "marked" with a string ignoring case and searching substring

Currently, when I use app.Tap I have to give it the exact string.
I want to do something like app.Tap("sstring") and still match elements marked with e.g. "somessting", "someSStRing", etc.
is it possible to have that somehow? it sounds like a simply thing, but I couldn't find a way to do it and it's surprising that there is no option to make it behave that way.
Have you tried doing it via the function overload and specifying the id?
app.Tap(e => e.Id("sstring"));
Marked searches many properties on each element to return any matches.

How to fetch multiple cq pages using Xpath based on page's property

I have two cq page and I want to retrive these two using jcr:title property using XPATH. The below query is working fine for single.
/jcr:root/content/test//element(*, cq:Page)[((jcr:like(jcr:content/#jcr:title, dell)))]
But I want to excuate it for multiple items. I have tried with following option but it is not working
/jcr:root/content/test//element(*, cq:Page)[((jcr:like(jcr:content/#jcr:title, [dell,samusng])))]
Could anyone help me to write xpath query?
As rakhi4110 already mentioned in the comment, you can combine multiple where clauses with an or just like in SQL. Though I think you either want exact matches or use jcr:containts instead of jcr:like.
Exact match:
/jcr:root/content/test//element(*, cq:Page) [jcr:content/#jcr:title='dell' or jcr:content/#jcr:title='samsung']
Contains:
/jcr:root/content/test//element(*, cq:Page) [jcr:contains(jcr:content/#jcr:title, 'dell') or jcr:contains(jcr:content/#jcr:title, 'samsung')]
Or if you really want to use jcr:like which, as in SQL, uses % for wildcard:
/jcr:root/content/test//element(*, cq:Page) [jcr:like(jcr:content/#jcr:title, '%dell%') or jcr:like(jcr:content/#jcr:title, '%samsung%')]

RethinkDB multiple queries in a single request

I'm trying to execute several RQL commands in a single request to server, without much success I may add. I have tried r.union, but it only works with sequences. What I really want:
[r.db(..).table(..).get(id1).delete(),
r.db(..).table(..).get(id2).delete(),
r.db(..).table(..).insert(...)].run_all_at_once
Is there any way to do this?
Thanks!
You can also use do
r.do(
r.table('test').insert({value1: "Hey"}),
r.table('test').insert({value2: "Ho"})
).run(conn);
The queries are evaluated from last to first
The response will be the last query's result
You can do
r.expr( [r.db(...).table(...).get(id1).delete(),
r.db(...).table(...).get(id1).delete(),
r.db(...).table(...).insert(...) ] ).run(conn)
Note that the method delete doesn't get an argument.

Prefix the result of a XPATH query

I use libxmljs to parse some html.
I have a xpath query which has an "or" conjunction to retrieve basically the information of two queries
Example
doc.find("//div[contains(#class,'important') or contains(#class,'overdue')]")
this returns all the divs with either important or overdue...
Can I prefix or see within my result set which comes from which condition?
The result could be an array with an index for the match 0 for the first condition and 1 for the 2... Is this possible...
Or how can I find out which result comes from which query condition...
Thanks for any help...
P.S.: this is a simplified exampled of a sequence of elements which either have an important or an overdue item ... both, one or none of them... So I cannot go by looking for every second entry ... etc
This is the result I want to get...
message:{},
message:{
.....
important: "some immportant text",
overdue: "overdue date,
.....
}
There is no way to know which clause of an or XPath query caused a particular result to be included. It's simply not information that's kept around.
You'll either need to do entirely separate queries for important and overdue, or do one large query to get the entire result set (as you are now) and then further test each result's class to find out which one it is.

SolrNet query assistance and some debugging options

How would I use SolrNet to execute a GREATER THAN/LESS THAN query?
Example:
My documents have a field called "minimumDays" and I only want to return docs where that field is LESS THAN OR EQUAL TO the number I pass into the query.
I currently have this, but am not sure it's correct.
int requestedDays = 3;
var minimumNightsQuery = new SolrQueryByRange<int>("minimumDays", 0, requestedDays, true);
Am I on the right track?
The second part here is if there is some way to better understand the query that is being passed into Solr from SolrNet? Debugging value or something where I can inspect the "q" variable for instance.
Thanks again for your help
You can use SolrQueryByRange for the first part of your question. Your code does look good. debugging your query and results might help. I have found that SolrNet does some odd things. - http://code.google.com/p/solrnet/wiki/Facets#Arbitrary_facet_queries
For the second part, You can intercept the ISolrConnection and put in your own in between. For a good start check this out: http://code.google.com/p/solrnet/source/browse/trunk/SampleSolrApp/LoggingConnection.cs?r=513
I have one that logs the query and the results, and if a config setting is on it appends the debug param and logs that result also. Its great info to have.... and one of the only ways to get it.

Resources