1 Reply Latest reply on Dec 21, 2006 5:51 PM by 488514

    More problems with java query API - getExcerpt fails

      If I write my code this way, everything works:

      mySearchRequest.setQuery(new oracle.ultrasearch.query.Contains(searchString, metadata));

      But if I do this, Document.getExcerpt() starts returning null for the same search hits:

      new oracle.ultrasearch.query.And(
      new oracle.ultrasearch.query.Contains(searchString, metadata),
      new oracle.ultrasearch.query.From(metadata.getGroup(groupToSearch))

      Does anybody know how to make this work? I need to limit my searches by groups so that I don't have to create a new UltraSearch Instance for every single web site that has to be crawled (I have several).

        • 1. Re: More problems with java query API - getExcerpt fails
          Well, I finally discovered he solution on my own, by reverse-engineering Oracle's own search.jsp (which does not use Oracle's custom tag library, btw) (probably because same doesn't really work, or at least it doesn't what's in the documentation doesn't work) (which isn't surprising).

          You have to do the "From" part of the query as an "attribute filter".

          oracle.ultrasearch.query.Query searchQuery=
          new oracle.ultrasearch.query.Contains(searchString, metadata);
          oracle.ultrasearch.query.Query attrQuery=
          new oracle.ultrasearch.query.From(metadata.getGroup(groupToSearch));
          oracle.ultrasearch.query.Request searchRequest=new oracle.ultrasearch.query.Request();
          searchRequest.setFilter (attrQuery);

          Maybe that will do somebody some good somewhere...