You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by Kay Kay <ka...@gmail.com> on 2009/01/15 01:10:54 UTC
SolrPluginUtils#parseQueryStrings(SolrQueryRequest, String[] ) -
LinkedList as implementation .
/** Turns an array of query strings into a List of Query objects.
*
* @return null if no queries are generated
*/
public static List<Query> parseQueryStrings(SolrQueryRequest req,
String[] queries) throws
ParseException {
if (null == queries || 0 == queries.length) return null;
List<Query> out = new *LinkedList*<Query>();
for (String q : queries) {
if (null != q && 0 != q.trim().length()) {
out*.add*(QParser.getParser(q, null, req).getQuery());
}
}
return out;
}
Just curious why a LinkedList<?> implementation is chosen here (as
compared to other implementations) when we add to the end of the list at
a later point. This seems to be used from the MoreLikeThisHandler .
Thanks.