Package org.apache.maven.index

Examples of org.apache.maven.index.UniqueArtifactFilterPostprocessor


    {
        NexusIndexer indexer = prepare();

        Query q = indexer.constructQuery( MAVEN.GROUP_ID, "commons", SearchType.SCORED );

        UniqueArtifactFilterPostprocessor filter = new UniqueArtifactFilterPostprocessor();
        filter.addField( MAVEN.GROUP_ID );
        filter.addField( MAVEN.ARTIFACT_ID );

        IteratorSearchRequest request = new IteratorSearchRequest( q, filter );

        IteratorSearchResponse response = indexer.searchIterator( request );
View Full Code Here


    // if the user is querying against these fields, we want to return them properly
    if (filters != null) {
      for (ArtifactInfoFilter filter : filters) {
        if (filter instanceof UniqueArtifactFilterPostprocessor) {
          UniqueArtifactFilterPostprocessor uFilter = (UniqueArtifactFilterPostprocessor) filter;

          if (terms.containsKey(MavenCoordinatesSearcher.TERM_VERSION)) {
            uFilter.addField(MAVEN.VERSION);
          }
          if (terms.containsKey(MavenCoordinatesSearcher.TERM_PACKAGING)) {
            uFilter.addField(MAVEN.PACKAGING);
          }
          if (terms.containsKey(MavenCoordinatesSearcher.TERM_CLASSIFIER)) {
            uFilter.addField(MAVEN.CLASSIFIER);
          }

          // in GAV search, we _always_ expand repository
          uFilter.addField(MAVEN.REPOSITORY_ID);

          break;
        }
      }
    }
View Full Code Here

          // filters should affect only Keyword and GAVSearch!
          // TODO: maybe we should left this to the given Searcher implementation to handle (like kw and gav
          // searcer is)
          // Downside would be that REST query params would be too far away from incoming call (too spread)
          if (searcher instanceof KeywordSearcher || searcher instanceof MavenCoordinatesSearcher) {
            UniqueArtifactFilterPostprocessor filter = new UniqueArtifactFilterPostprocessor();

            filter.addField(MAVEN.GROUP_ID);
            filter.addField(MAVEN.ARTIFACT_ID);

            if (Boolean.TRUE.equals(expandVersion)) {
              filter.addField(MAVEN.VERSION);
            }
            if (Boolean.TRUE.equals(expandPackaging)) {
              filter.addField(MAVEN.PACKAGING);
            }
            if (Boolean.TRUE.equals(expandClassifier)) {
              filter.addField(MAVEN.CLASSIFIER);
            }

            filters.add(filter);

            uniqueRGA = true;
View Full Code Here

TOP

Related Classes of org.apache.maven.index.UniqueArtifactFilterPostprocessor

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.