Solrj Block Join Bean support - solr

I would like to use a Solrj Bean to save/query nested documents from Solr. Is this possible? I see that since version 4.5 it is possible to use addChildDocument(SolrInputDocument child) but looking at the source code for org.apache.solr.client.solrj.beans.DocumentObjectBinder I see that nested documents are not taken into consideration. A new annotation additional to the #Field annotation would also be required I guess. Does anyone have any experience with this?

If you want to insert nested document as a bean to solr using #Field(child=true) annotation then see below URL:
SOLRJ-6.0.0: Insertion of a bean object which associate list of bean object is giving null pointer exception

Related

Access Camel exchange property in XML DSL

Assuming I have set a Camel exchange property in a Processor ...Example
exchange.setProperty(LASTPROCESSED, sortedBody[0].attribute6)
What would be the proper way of referencing this property in my XML based route ?
I tried ${property:LASTPROCESSED} and ${exchangeProperty:LASTPROCESSED}
I have no trouble referencing exchange Headers ( i.e. ${headers.xxx} )
Yes ...I have trolled through countless answers here without finding a solution.
I am running Camel 3.x
Turns out I had an issue elsewhere in the Route ...the proper way to access appears to be ${exchangeProperty.xxx}

Camel Restlet - Binding query parameters to message headers

Looking through Camel docs I couldn't find any way that allow me to bind the query parameters within the headers. For example :
Let's say I have an endpoint like that
http://localhost:8080/services/resource?filter=xxx
End I want to get that parameter from the header
exchange.getIn.().getHeaders().get('filter')
The query parameter 'filter' is not returned in the header. Anyone of you knows if this feature is coming by default in camel? I know I can build the binding by myself, but i am just looking for choose among camel-servlet (apparently that binding is implemented by default) and camel-restlet.
If you choose camel-restlet you can use the
restletBinding=#refName
to convert the query string parameters to headers.
The #refName is the bean ID of a RestletBinding object in the Camel Registry.

Adding raw query parameters via Criteria API

I could not find an answer to this. I found the previous similar question unanswered. I'd like to use Spring data solr for queries. But #Query is insufficient for my needs. As I understood, whatever you give here becomes a q parameter to `select' handler of solr.
In my case I need to add more parameters for example sfield for a spatial search. If #Query wont cut it, I am ready to write a custom repository implementation by autowiring SolrTemplate, But then the Criteria API does not seem to let me add a raw query parameter either.
Any help/points will be greatly appreciated.
I worked around it by creating a QueryParser decorator that adds the required parameters to a parsed solr query. The QueryParser was registered using solrTemplate.registerQueryParser().
Note however that I had to do a really nasty hack to get this working, since all queries that are sent to solrTemplate.queryForPage are wrapped by a static package protected inner class in QueryBase. So my registration code above had to be in a package org.springframework.data.solr.core

How to get IndexReader from custom request handler?

This is extension of my earlier question.
I'm going to create custom request handler to provide terms association mining over existing index. In order to do this I need access to Solr's IndexReader opened on default index directory.
The only way to do this I can think of is to get IndexReaderFactory by invoking SolrQueryRequest.getCore().getIndexReaderFactory(). This factory has method newReader() which seems to be what I need. But this method requires index directory as its first argument.
Here's my question: is it correct way to get IndexReader? If so, how can I get Solr's index directory? Can I access Solr configuration to find it from my code or should I go with something else?
I found an answer myself while reading LukeRequestHandler source:
SolrIndexSearcher searcher = req.getSearcher();
IndexReader reader = searcher.getReader();
So they first get searcher, and only then reader.

Index-time boosting using DIH with JdbcDataSource

Is it possible to add boosts to docs and fields in Solr 1.4 DIH when using a JdbcDataSource? The documentation seem to suggest it's possible but I can't find any examples.
There are a few examples of how to add the boost="2.0" attribute to your docs/fields in XML imports, but how do you do the same with the JdbcDataSource?
The closest I could get to an answer was http://www.nabble.com/data-import-handler---going-deeper...-td20731715.html
Add a special value $fieldBoost. to the row map
Has this been implemented yet?
$fieldBoost is not implemented, but $docBoost is.
Source code.
Special commands docs.
This is not an answer, If you want to change the score of the field or the document you have added
http://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_boost_the_score_of_newer_documents
just go through above link

Resources