You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2020/07/04 11:00:54 UTC

[lucene-solr] 11/14: SOLR-14358 respond to feedback on URLClassifyProcessorFactory (#1632)

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

ab pushed a commit to branch jira/solr-12847-2
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit eb30238fd4fdf64541211a1941b4a4508fcab185
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