Reputation: 881
I am indexing data in solr with using dynamic field (Schemaless Feature). Like I have some fields like product_txt,id_i,category_txt etc..
I want the above mentioned fields to be product,id,category in response while selecting from solr. Like want to remove the suffix _txt, _i from fields while returning from solr.
Is this possible in SOLR itself?. If yes,Please help.
Upvotes: 1
Views: 278
Reputation: 52892
You can use field aliasing, but it requires you to list the alias for each field in the fl
parameter:
product_txt:product,id_i:id,category_txt:category
Upvotes: 2
Reputation: 8668
I think anything cannot be done at solr end for this ..
You have to manually add some code at client side to remove the extra thing i.e suffix in your case.
like at java end you can use
String responseString = "product_txt";
String result = responseString.substring(0, responseString.lastIndexOf("_")) ;
Upvotes: 0