You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ep...@apache.org on 2020/07/02 19:16:35 UTC

[lucene-solr] branch master updated: SOLR-14358 respond to feedback on URLClassifyProcessorFactory (#1632)

This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/master by this push:
     new b50dd0c  SOLR-14358 respond to feedback on URLClassifyProcessorFactory (#1632)
b50dd0c is described below

commit b50dd0c9c78f5973fe9a3d604390472cc0d66593
Author: Eric Pugh <ep...@opensourceconnections.com>
AuthorDate: Thu Jul 2 15:16:24 2020 -0400

    SOLR-14358 respond to feedback on URLClassifyProcessorFactory (#1632)
    
    * Add an example explaining how to use
    
    * fix up JavaDoc formatting
    
    * Respond to feedback from @janhoy
    
    Co-authored-by: ohtwadi <ha...@gmail.com>
---
 .../org/apache/solr/update/processor/URLClassifyProcessor.java | 10 +++++-----
 .../apache/solr/update/processor/URLClassifyProcessorTest.java |  2 ++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/update/processor/URLClassifyProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/URLClassifyProcessor.java
index fc75a45..2e846ec 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/URLClassifyProcessor.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/URLClassifyProcessor.java
@@ -89,11 +89,11 @@ import org.slf4j.LoggerFactory;
  * <pre class="prettyprint">
  * {
  *  "id":"http://wwww.mydomain.com/subpath/document.html",
- *  "url_length":["46"],
- *  "url_levels":["2"],
- *  "url_toplevel":["0"],
- *  "url_landingpage":["0"],
- *  "hostname":["wwww.mydomain.com"],
+ *  "url_length":46,
+ *  "url_levels":2,
+ *  "url_toplevel":0,
+ *  "url_landingpage":0,
+ *  "hostname":"wwww.mydomain.com",
  *  "_version_":1603193062117343232}]
  * }
  * </pre>
diff --git a/solr/core/src/test/org/apache/solr/update/processor/URLClassifyProcessorTest.java b/solr/core/src/test/org/apache/solr/update/processor/URLClassifyProcessorTest.java
index 1b36bc6..f04118c 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/URLClassifyProcessorTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/URLClassifyProcessorTest.java
@@ -44,6 +44,8 @@ public class URLClassifyProcessorTest extends SolrTestCaseJ4 {
     document.addField("url", "http://www.example.com");
     addCommand.solrDoc = document;
     classifyProcessor.processAdd(addCommand);
+    assertEquals("Confirm single valued field returned",1, document.getField("url_length").getValueCount());
+    assertEquals("Confirm field populated",22, document.getField("url_length").getValue());
   }
   
   @Test