On 2/1/07, Ryan McKinley <[EMAIL PROTECTED]> wrote:
I am (was?) using DISTINCT to say, only add the unique fields.  As
implemented, it keeps a Collection<String> for each field name.  If
the 'mode' is 'DISTINCT' the collection is Set<String>, otherwise
List<String>

Ah, OK... that does seem useful.

How would you feel about an interface like this:

Not sure... depends on how update handlers will use it...
One thing we might not want to get rid of though is streaming
(constructing and adding a document, then discarding it).  People are
starting to add a lot of documents in a single XML request, and this
will be much larger for CVS/SQL.

For that reason, I'm not sure how often the "Collection" part will be utilized.

I like the it OK on the conceptual level though.

-Yonik

public class IndexDocumentsCommand
{
  public enum MODE {
    APPEND,    // add the fields to existing fields
    OVERWRITE, // overwrite existing fields
    INCREMENT, // increment existing field
    DISTINCT   // same as APPEND, but make sure there are distinct values
  };

  // optional id in "internal" indexed form... if it is needed and not supplied,
  // it will be obtained from the doc.
  public String indexedId;

  public Collection<SolrDocument> docs;
  public boolean allowDups;
  public boolean overwrite;
  public SimpleOrderedMap<MODE> modifyFieldMode; // What to do for
each field.  We should support *
  public int commitMaxTime = -1; // make sure these documents are
committed within this much time
}

Reply via email to