You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/09/02 09:49:21 UTC

[GitHub] [lucene-solr] bruno-roustant opened a new pull request #1819: SOLR-14782: Document how to unescape for the QueryElevationComponent.

bruno-roustant opened a new pull request #1819:
URL: https://github.com/apache/lucene-solr/pull/1819


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] bruno-roustant commented on a change in pull request #1819: SOLR-14782: Document how to unescape for the QueryElevationComponent.

Posted by GitBox <gi...@apache.org>.
bruno-roustant commented on a change in pull request #1819:
URL: https://github.com/apache/lucene-solr/pull/1819#discussion_r482110458



##########
File path: solr/solr-ref-guide/src/the-query-elevation-component.adoc
##########
@@ -61,7 +61,18 @@ Optionally, in the Query Elevation Component configuration you can also specify
 The Query Elevation Search Component takes the following parameters:
 
 `queryFieldType`::
-Specifies which fieldType should be used to analyze the incoming text. For example, it may be appropriate to use a fieldType with a LowerCaseFilter.
+Specifies which fieldType should be used to analyze the incoming text. For example, it may be appropriate to use a fieldType with a LowerCaseFilter. Other example, if you need to unescape backslash-escaped queries, then you can define the fieldType to preprocess with a PatternReplaceCharFilter. Here is the corresponding example of fieldType (traditionally in `schema.xml`):
+
+[source,xml]
+----
+<fieldType name="unescapelowercase" class="solr.TextField">
+  <analyzer>
+    <charFilter class="solr.PatternReplaceCharFilterFactory" pattern="\\(.)" replacement="$1"/>

Review comment:
       Indeed, but do we want to go into this level of detail?
   The Lucene StandardQueryParser uses EscapeQuerySyntaxImpl.discardEscapeChar() which unescape everything without distinction except it detects unicode \uxxxx and converts it.
   I suggest that we give a basic example of unescaping every backslash. If the user wants more sophisticated logic, then she will design the right pattern or the custom CharFilter.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] bruno-roustant commented on a change in pull request #1819: SOLR-14782: Document how to unescape for the QueryElevationComponent.

Posted by GitBox <gi...@apache.org>.
bruno-roustant commented on a change in pull request #1819:
URL: https://github.com/apache/lucene-solr/pull/1819#discussion_r482123493



##########
File path: solr/solr-ref-guide/src/the-query-elevation-component.adoc
##########
@@ -61,7 +61,18 @@ Optionally, in the Query Elevation Component configuration you can also specify
 The Query Elevation Search Component takes the following parameters:
 
 `queryFieldType`::
-Specifies which fieldType should be used to analyze the incoming text. For example, it may be appropriate to use a fieldType with a LowerCaseFilter.
+Specifies which fieldType should be used to analyze the incoming text. For example, it may be appropriate to use a fieldType with a LowerCaseFilter. Other example, if you need to unescape backslash-escaped queries, then you can define the fieldType to preprocess with a PatternReplaceCharFilter. Here is the corresponding example of fieldType (traditionally in `schema.xml`):
+
+[source,xml]
+----
+<fieldType name="unescapelowercase" class="solr.TextField">
+  <analyzer>
+    <charFilter class="solr.PatternReplaceCharFilterFactory" pattern="\\(.)" replacement="$1"/>

Review comment:
       Actually it is possible to localize the pattern with
   "\\\\([^\\p{javaLowerCase}\\p{javaUpperCase}\\p{Digit}])"




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] bruno-roustant commented on a change in pull request #1819: SOLR-14782: Document how to unescape for the QueryElevationComponent.

Posted by GitBox <gi...@apache.org>.
bruno-roustant commented on a change in pull request #1819:
URL: https://github.com/apache/lucene-solr/pull/1819#discussion_r482123493



##########
File path: solr/solr-ref-guide/src/the-query-elevation-component.adoc
##########
@@ -61,7 +61,18 @@ Optionally, in the Query Elevation Component configuration you can also specify
 The Query Elevation Search Component takes the following parameters:
 
 `queryFieldType`::
-Specifies which fieldType should be used to analyze the incoming text. For example, it may be appropriate to use a fieldType with a LowerCaseFilter.
+Specifies which fieldType should be used to analyze the incoming text. For example, it may be appropriate to use a fieldType with a LowerCaseFilter. Other example, if you need to unescape backslash-escaped queries, then you can define the fieldType to preprocess with a PatternReplaceCharFilter. Here is the corresponding example of fieldType (traditionally in `schema.xml`):
+
+[source,xml]
+----
+<fieldType name="unescapelowercase" class="solr.TextField">
+  <analyzer>
+    <charFilter class="solr.PatternReplaceCharFilterFactory" pattern="\\(.)" replacement="$1"/>

Review comment:
       Actually it is possible to localize the pattern with
   "\\\\([^\\p{IsAlphabetic}\\p{Digit}])"




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dsmiley commented on a change in pull request #1819: SOLR-14782: Document how to unescape for the QueryElevationComponent.

Posted by GitBox <gi...@apache.org>.
dsmiley commented on a change in pull request #1819:
URL: https://github.com/apache/lucene-solr/pull/1819#discussion_r482097781



##########
File path: solr/solr-ref-guide/src/the-query-elevation-component.adoc
##########
@@ -61,7 +61,18 @@ Optionally, in the Query Elevation Component configuration you can also specify
 The Query Elevation Search Component takes the following parameters:
 
 `queryFieldType`::
-Specifies which fieldType should be used to analyze the incoming text. For example, it may be appropriate to use a fieldType with a LowerCaseFilter.
+Specifies which fieldType should be used to analyze the incoming text. For example, it may be appropriate to use a fieldType with a LowerCaseFilter. Other example, if you need to unescape backslash-escaped queries, then you can define the fieldType to preprocess with a PatternReplaceCharFilter. Here is the corresponding example of fieldType (traditionally in `schema.xml`):
+
+[source,xml]
+----
+<fieldType name="unescapelowercase" class="solr.TextField">
+  <analyzer>
+    <charFilter class="solr.PatternReplaceCharFilterFactory" pattern="\\(.)" replacement="$1"/>

Review comment:
       I think there's a syntax to use such that we only un-escape non-alphanumeric?  If they type a\b (which might be in some identifier) then they probably meant that.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] bruno-roustant commented on a change in pull request #1819: SOLR-14782: Document how to unescape for the QueryElevationComponent.

Posted by GitBox <gi...@apache.org>.
bruno-roustant commented on a change in pull request #1819:
URL: https://github.com/apache/lucene-solr/pull/1819#discussion_r482130641



##########
File path: solr/solr-ref-guide/src/the-query-elevation-component.adoc
##########
@@ -61,7 +61,18 @@ Optionally, in the Query Elevation Component configuration you can also specify
 The Query Elevation Search Component takes the following parameters:
 
 `queryFieldType`::
-Specifies which fieldType should be used to analyze the incoming text. For example, it may be appropriate to use a fieldType with a LowerCaseFilter.
+Specifies which fieldType should be used to analyze the incoming text. For example, it may be appropriate to use a fieldType with a LowerCaseFilter. Other example, if you need to unescape backslash-escaped queries, then you can define the fieldType to preprocess with a PatternReplaceCharFilter. Here is the corresponding example of fieldType (traditionally in `schema.xml`):
+
+[source,xml]
+----
+<fieldType name="unescapelowercase" class="solr.TextField">
+  <analyzer>
+    <charFilter class="solr.PatternReplaceCharFilterFactory" pattern="\\(.)" replacement="$1"/>

Review comment:
       I added this other pattern as an example.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] bruno-roustant closed pull request #1819: SOLR-14782: Document how to unescape for the QueryElevationComponent.

Posted by GitBox <gi...@apache.org>.
bruno-roustant closed pull request #1819:
URL: https://github.com/apache/lucene-solr/pull/1819


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] bruno-roustant commented on a change in pull request #1819: SOLR-14782: Document how to unescape for the QueryElevationComponent.

Posted by GitBox <gi...@apache.org>.
bruno-roustant commented on a change in pull request #1819:
URL: https://github.com/apache/lucene-solr/pull/1819#discussion_r482119547



##########
File path: solr/solr-ref-guide/src/the-query-elevation-component.adoc
##########
@@ -61,7 +61,18 @@ Optionally, in the Query Elevation Component configuration you can also specify
 The Query Elevation Search Component takes the following parameters:
 
 `queryFieldType`::
-Specifies which fieldType should be used to analyze the incoming text. For example, it may be appropriate to use a fieldType with a LowerCaseFilter.
+Specifies which fieldType should be used to analyze the incoming text. For example, it may be appropriate to use a fieldType with a LowerCaseFilter. Other example, if you need to unescape backslash-escaped queries, then you can define the fieldType to preprocess with a PatternReplaceCharFilter. Here is the corresponding example of fieldType (traditionally in `schema.xml`):
+
+[source,xml]
+----
+<fieldType name="unescapelowercase" class="solr.TextField">
+  <analyzer>
+    <charFilter class="solr.PatternReplaceCharFilterFactory" pattern="\\(.)" replacement="$1"/>

Review comment:
       The regex would be "\\([^\p{Alnum}])", but it applies to ASCII alphanum, not internationalized.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] bruno-roustant commented on a change in pull request #1819: SOLR-14782: Document how to unescape for the QueryElevationComponent.

Posted by GitBox <gi...@apache.org>.
bruno-roustant commented on a change in pull request #1819:
URL: https://github.com/apache/lucene-solr/pull/1819#discussion_r482119547



##########
File path: solr/solr-ref-guide/src/the-query-elevation-component.adoc
##########
@@ -61,7 +61,18 @@ Optionally, in the Query Elevation Component configuration you can also specify
 The Query Elevation Search Component takes the following parameters:
 
 `queryFieldType`::
-Specifies which fieldType should be used to analyze the incoming text. For example, it may be appropriate to use a fieldType with a LowerCaseFilter.
+Specifies which fieldType should be used to analyze the incoming text. For example, it may be appropriate to use a fieldType with a LowerCaseFilter. Other example, if you need to unescape backslash-escaped queries, then you can define the fieldType to preprocess with a PatternReplaceCharFilter. Here is the corresponding example of fieldType (traditionally in `schema.xml`):
+
+[source,xml]
+----
+<fieldType name="unescapelowercase" class="solr.TextField">
+  <analyzer>
+    <charFilter class="solr.PatternReplaceCharFilterFactory" pattern="\\(.)" replacement="$1"/>

Review comment:
       The regex would be "\\\\([^\\p{Alnum}])", but it applies to ASCII alphanum, not internationalized.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org