Virtual index and using the java api

Submitted by jek on Tue, 2012-12-11 07:02.Troubleshooting

I'm try to get the virtual index working.
Unfortunally I'm not able to query this index.
To resolve my problem I'm try now to query multiple indexes using the java api.
However the api only returns data of the first index and not an aggregate result of the two indexes provided.
Please provide information on how to perform such action.
I'm using the dbsight version 4.3.17 (b431) free edition.
My code;

s = new SearchConnection("http://localhost:8080/dbsight/")
.setIndex("index1", "index2");
String param = "opel corsa expression 1.0";
SearchQuery q = new SearchQuery(param).setDebug(true)
try {
searchResult =; "SearchResult:{}", searchResult.getTotal() );
} catch (IOException e) {
searchResult = new Result("none");

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Submitted by jek on Mon, 2012-12-17 10:08.

Ok, thanks.
Is it possible to call the search functionality from a portlet.
So that means bypassing the struts framework and calling the engine myself in the portlet code or other frameworks (such as jsf) for instance.
I have tried the api but this doesn't give information on facet searching as the native api does. I'm missing for instance the parent relation that is available in the local search.

I'm expecting that the search engine is available in the application context or something like that.

Submitted by will on Mon, 2012-12-17 15:49.

The parent~child relationship between facet is actually maintained in the template system. So if you want to use it in portlet, you will have to implement it yourself. It's not ideal, but this should be simple though.

Submitted by jek on Tue, 2012-12-18 09:55.

I have had a look at solr; is there also an option to group facets with the parent involved?
I want to keep the parent relation so that the information is also groupable in such a sence.
example chevrolet -> volt -> 5 items, honda -> civic -> 10 items.

Submitted by will on Thu, 2012-12-20 13:47.

For this, you would need to adjust how the index is built. Let's say you have 2 columns, "company" and "brand". You can create index with these two columns:

 select company column1, company || '>' || brand as column2, ... 
 from data_table

Then you can configure column1 and column2 as filterable.

Submitted by jek on Fri, 2012-12-21 11:59.

ok, thanks.

Submitted by will on Wed, 2012-12-12 10:07.

Actually this is not called "virtual index", but a sharded search. The difference is that, virtual index is for indexes with different fields, while sharded search is for indexes with same fields.

I am suspecting you want to search 2 different indexes. For that purpose, it is easier to simply search twice.