thanks Peter, Hoss and Ryan..
q=(URL:[* TO *] -URL:"")
This gives me 400 Query parsing error: Cannot parse '(URL:[* TO *] -
URL:"")': Lexical error at line 1, column 29. Encountered: "\"" (34),
after : "\""
adding something like:
<filter class="solr.LengthFilterFactory" min="1" max="10000" />
I'll do this but the problem here is I have to wait around for all
these docs to re-index..
Your query will work if you make sure the URL field is omitted from
the
document at index time when the field is blank.
The thing is, I thought I was omitting the field if it's blank. It's
in a solrj instance that takes a lucenedocument, so maybe it's a
solrj issue?
if( URL != null && URL.length() > 5 )
doc.add(new Field("URL", URL, Field.Store.YES,
Field.Index.UN_TOKENIZED));
And then during indexing:
SimpleSolrDoc solrDoc = new SimpleSolrDoc();
solrDoc.setBoost( null, new Float ( doc.getBoost()));
for (Enumeration<Field> e = doc.fields(); e.hasMoreElements();) {
Field field = e.nextElement();
if (!ignoreFields.contains((field.name()))) {
solrDoc.addField(field.name(), field.stringValue());
}
}
try {
solr.add(solrDoc);
...