Github user GERey commented on a diff in the pull request: https://github.com/apache/incubator-usergrid/pull/256#discussion_r31070692 --- Diff: stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsApplicationEntityIndexImpl.java --- @@ -173,6 +184,161 @@ public CandidateResults search( final SearchEdge searchEdge, final SearchTypes s } + @Override + public CandidateResults getAllEdgeDocuments( final IndexEdge edge, final Id entityId ) { + /** + * Take a list of IndexEdge, with an entityId + and query Es directly for matches + + */ + IndexValidationUtils.validateSearchEdge( edge ); + Preconditions.checkNotNull( entityId, "entityId cannot be null" ); + + SearchResponse searchResponse; + + List<CandidateResult> candidates = new ArrayList<>(); + + final ParsedQuery parsedQuery = ParsedQueryBuilder.build( "select *" ); + + final SearchRequestBuilder srb = searchRequestBuilderStrategyV2.getBuilder(); + + //I can't just search on the entity Id. + + FilterBuilder entityEdgeFilter = FilterBuilders.termFilter( IndexingUtils.EDGE_NODE_ID_FIELDNAME, + IndexingUtils.idString( edge.getNodeId() )); + + srb.setPostFilter(entityEdgeFilter); + + if ( logger.isDebugEnabled() ) { + logger.debug( "Searching for marked versions in index (read alias): {}\n nodeId: {},\n query: {} ", + this.alias.getReadAlias(),entityId, srb ); + } + + try { + //Added For Graphite Metrics + Timer.Context timeSearch = searchTimer.time(); + + //set the timeout on the scroll cursor to 6 seconds and set the number of values returned per shard to 100. + //The settings for the scroll aren't tested and so we aren't sure what vlaues would be best in a production enviroment + //TODO: review this and make them not magic numbers when acking this PR. + searchResponse = srb.setScroll( new TimeValue( 6000 ) ).setSize( 100 ).execute().actionGet(); --- End diff -- This some comments on. Not sure what values we want here.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---