Package proj.zoie.api.indexing

Examples of proj.zoie.api.indexing.AbstractZoieIndexable


                throw new RuntimeException(e.getMessage(), e);
            }
        } else {
            filtered = src;
        }
        return new AbstractZoieIndexable() {
            /**
             * Process a field with the given value according to the field definition and add the result to lucene document.
             * @param filedName name of the field.
             * @param fieldVal  value of the field.
             * @param fieldDef  field specification
View Full Code Here


public abstract class JSONDataInterpreter extends AbstractZoieIndexableInterpreter<JSONObject> {

  @Override
  public ZoieIndexable convertAndInterpret(final JSONObject src) {
    return new AbstractZoieIndexable(){

      @Override
      public IndexingReq[] buildIndexingReqs() {
        try{
        return new IndexingReq[]{new IndexingReq(buildDoc(src))};
View Full Code Here

  @Override
  public ZoieIndexable convertAndInterpret(String tweet) {
    try {
      final String text = tweet;
      final long uid = id++;
      return new AbstractZoieIndexable() {

        @Override
        public IndexingReq[] buildIndexingReqs() {
          Document doc = new Document();
          doc.add(new Field("contents", text, Store.NO, Index.ANALYZED));
          return new IndexingReq[] { new IndexingReq(doc) };
        }

        @Override
        public long getUID() {
          return uid;
        }

        @Override
        public boolean isDeleted() {
          return false;
        }

        @Override
        public boolean isSkip() {
          return false;
        }

      };
    } catch (Exception e) {
      return new AbstractZoieIndexable() {

        @Override
        public IndexingReq[] buildIndexingReqs() {
          return null;
        }
View Full Code Here

          try {
            ZoieIndexable indexable = interpreter.convertAndInterpret(src);
            return indexable;
          } catch (Exception e) {
            log.error(e.getMessage(), e);
            return new AbstractZoieIndexable() {

              @Override
              public long getUID() {
                return Long.MIN_VALUE;
              }
View Full Code Here

  }

  public ZoieIndexable interpret(final String src) {
    String[] parts = src.split(" ");
    final long id = Long.parseLong(parts[parts.length - 1]) + ((Integer.MAX_VALUE) * 2L);
    return new AbstractZoieIndexable() {
      public Document buildDocument() {
        Document doc = new Document();
        doc.add(new TextField("contents", src, Store.NO));
        doc.add(new StringField("id", String.valueOf(id), Store.YES));
        try {
View Full Code Here

  }

  public ZoieIndexable interpret(final String src) {
    String[] parts = src.split(" ");
    final long id = Long.parseLong(parts[parts.length - 1]);
    return new AbstractZoieIndexable() {
      public Document buildDocument() {
        Document doc = new Document();
        doc.add(new TextField("contents", src, Store.NO));
        doc.add(new StringField("id", String.valueOf(id), Store.YES));
        try {
View Full Code Here

TOP

Related Classes of proj.zoie.api.indexing.AbstractZoieIndexable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.