Skip to content

Instantly share code, notes, and snippets.

@adben
Created December 2, 2010 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adben/725404 to your computer and use it in GitHub Desktop.
Save adben/725404 to your computer and use it in GitHub Desktop.
old_id is null natuurlijk....
org.netbeans.modules.viewmodel.TreeModelNode@77e48879[Name=, displayName=attributes] Map<String,Map<String,Object>> "size = 3"
org.netbeans.modules.viewmodel.TreeModelNode@1ce25976[Name=, displayName=[0]] HashMap$Entry "buz_t_name => {name=buz_t_name, value=[a*], label=name, type=class java.lang.String}"
org.netbeans.modules.viewmodel.TreeModelNode@505f60ca[Name=, displayName=[1]] HashMap$Entry "buz_t_email => {name=buz_t_email, label=email, type=class java.lang.String}"
org.netbeans.modules.viewmodel.TreeModelNode@25cb96ff[Name=, displayName=[2]] HashMap$Entry "old_id => null"
@adben
Copy link
Author

adben commented Dec 2, 2010

public class SolrHelper {
.....
public static SolrQuery generateSolrQuery(Map<String, Map<String, Object>> attributes) {
SolrQuery result = new SolrQuery();

StringBuilder query = new StringBuilder();
List<String> fields = new ArrayList<String>();
boolean firstEmitted = false;
for (String attributeId : attributes.keySet()) {
  fields.add(attributeId);
  Map<String, Object> attribute = attributes.get(attributeId);
  if (attribute.get(Constants.getInstance().ATTRIBUTE_VALUE) != null) {
    query.append(generateSolrQueryAttribute(attribute, firstEmitted));
    firstEmitted = true;
  }
}

....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment