WAVE-311 Updates to allow user data wavelets into the Solr index.

Project: http://git-wip-us.apache.org/repos/asf/incubator-wave/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-wave/commit/b45dc71c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-wave/tree/b45dc71c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-wave/diff/b45dc71c

Branch: refs/heads/wave-0.4-rc6
Commit: b45dc71ce2d38a2e542e7294d0ad151107aa9196
Parents: da20b42
Author: Yuri Zelikov <[email protected]>
Authored: Sat Apr 12 11:58:13 2014 +0300
Committer: Yuri Zelikov <[email protected]>
Committed: Wed Aug 27 19:17:55 2014 +0300

----------------------------------------------------------------------
 .../waveserver/SolrSearchProviderImpl.java      | 18 --------
 .../server/waveserver/SolrWaveIndexerImpl.java  | 48 ++------------------
 2 files changed, 3 insertions(+), 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/b45dc71c/src/org/waveprotocol/box/server/waveserver/SolrSearchProviderImpl.java
----------------------------------------------------------------------
diff --git 
a/src/org/waveprotocol/box/server/waveserver/SolrSearchProviderImpl.java 
b/src/org/waveprotocol/box/server/waveserver/SolrSearchProviderImpl.java
index 607a295..2ed82e3 100644
--- a/src/org/waveprotocol/box/server/waveserver/SolrSearchProviderImpl.java
+++ b/src/org/waveprotocol/box/server/waveserver/SolrSearchProviderImpl.java
@@ -201,26 +201,8 @@ public class SolrSearchProviderImpl extends 
SimpleSearchProviderImpl implements
             WaveletId waveletId =
                 
WaveletId.deserialise(docJson.getAsJsonPrimitive(WAVELET_ID).getAsString());
             currentUserWavesView.put(waveId, waveletId);
-
-            /*-
-             * XXX (Frank R.) (experimental and disabled) reduce round trips 
to solr
-             *
-             * the result list will be filtered. so we need all results
-             */
-            // if (currentUserWavesView.size() >= numResults) {
-            // break;
-            // }
           }
 
-          /*-
-           * XXX (Frank R.) (experimental and disabled) reduce round trips to 
solr
-           *
-           * the result list will be filtered. so we need all results
-           */
-          // if (currentUserWavesView.size() >= numResults) {
-          // break;
-          // }
-
           /*
            * there won't be any more results - stop querying next page of
            * results

http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/b45dc71c/src/org/waveprotocol/box/server/waveserver/SolrWaveIndexerImpl.java
----------------------------------------------------------------------
diff --git 
a/src/org/waveprotocol/box/server/waveserver/SolrWaveIndexerImpl.java 
b/src/org/waveprotocol/box/server/waveserver/SolrWaveIndexerImpl.java
index 0b57272..8c471ef 100644
--- a/src/org/waveprotocol/box/server/waveserver/SolrWaveIndexerImpl.java
+++ b/src/org/waveprotocol/box/server/waveserver/SolrWaveIndexerImpl.java
@@ -232,8 +232,8 @@ public class SolrWaveIndexerImpl extends 
AbstractWaveIndexer implements WaveBus.
   private void updateIndex(ReadableWaveletData wavelet) throws IndexException {
 
     Preconditions.checkNotNull(wavelet);
-
-    if (!IdUtil.isConversationRootWaveletId(wavelet.getWaveletId())) {
+    boolean isUserDataWavelet = 
IdUtil.isUserDataWavelet(wavelet.getWaveletId());
+    if (!(IdUtil.isConversationRootWaveletId(wavelet.getWaveletId()) || 
isUserDataWavelet)) {
       return;
     }
 
@@ -247,63 +247,21 @@ public class SolrWaveIndexerImpl extends 
AbstractWaveIndexer implements WaveBus.
       String modified = Long.toString(wavelet.getLastModifiedTime());
       String creator = wavelet.getCreator().getAddress();
 
-      /*
-       * (regression alert) gets wave title - too much overhead for updating
-       * index. on rendering search results, solr-bot builds link texts with
-       * WaveDigester
-       */
-      // String title =
-      // getTitle(wavelet.getWaveId(), wavelet.getWaveletId(), waveMap,
-      // conversationUtil);
-
       for (String docName : wavelet.getDocumentIds()) {
         ReadableBlipData document = wavelet.getDocument(docName);
 
-        /*
-         * skips non-blip documents
-         */
-        if (!IdUtil.isBlipId(docName)) {
+        if (!(IdUtil.isBlipId(docName) || isUserDataWavelet)) {
           continue;
         }
 
         String text = readText(document);
 
-
-        /*
-         * (regression alert) it hangs at
-         * com.google.common.collect.Iterables.cycle(T...)
-         */
-        // String text =
-        // Snippets
-        // .collateTextForOps(Iterables.cycle((DocOp)
-        // document.getContent().asOperation()));
-
-        /*
-         * (regression alert) cannot reuse Snippets because it trims the
-         * content.
-         */
-        // Iterable<DocOp> docs = Arrays.asList((DocOp)
-        // document.getContent().asOperation());
-        // String text = Snippets.collateTextForOps(docs);
-
-        /*-
-         * XXX (Frank R.) (experimental) skips invisible blips
-         * a newly created blip starts with (and contains only)
-         * a new line character, and is not treated as invisible
-         */
-        if (text.length() == 0) {
-          continue;
-        }
-
         JsonArray participantsJson = new JsonArray();
         for (ParticipantId participant : wavelet.getParticipants()) {
           String participantAddress = participant.toString();
           participantsJson.add(new JsonPrimitive(participantAddress));
         }
 
-        /*
-         * id will be something like waveId + "/~/conv+root/" + docName
-         */
         String id =
             
JavaWaverefEncoder.encodeToUriPathSegment(WaveRef.of(wavelet.getWaveId(),
                 wavelet.getWaveletId(), docName));

Reply via email to