Browse Source

Fix language in some docs

The pattern-analyzer docs contained a snippet that was an expanded
regex that was marked as `[source,js]`. This changes it to
`[source,regex]`.

The htmlstrip-charfilter and pattern-replace-charfilter docs had
examples that were actually a list of tokens but marked `[source,js]`.
This marks them as `[source,text]` so they don't count as unconverted
CONSOLE snippets.

The pattern-replace-charfilter also had a doc who's test was
skipped because of funny interaction with the test framework. This
fixes the test.

Three more down, eighty-two to go.

Relates to #18160
Nik Everett 8 years ago
parent
commit
514187be8e

+ 0 - 3
docs/build.gradle

@@ -53,9 +53,6 @@ buildRestTests.expectedUnconvertedCandidates = [
   'reference/aggregations/pipeline/serial-diff-aggregation.asciidoc',
   'reference/aggregations/pipeline/stats-bucket-aggregation.asciidoc',
   'reference/aggregations/pipeline/sum-bucket-aggregation.asciidoc',
-  'reference/analysis/analyzers/pattern-analyzer.asciidoc',
-  'reference/analysis/charfilters/htmlstrip-charfilter.asciidoc',
-  'reference/analysis/charfilters/pattern-replace-charfilter.asciidoc',
   'reference/analysis/tokenfilters/asciifolding-tokenfilter.asciidoc',
   'reference/analysis/tokenfilters/cjk-bigram-tokenfilter.asciidoc',
   'reference/analysis/tokenfilters/common-grams-tokenfilter.asciidoc',

+ 1 - 2
docs/reference/analysis/analyzers/pattern-analyzer.asciidoc

@@ -366,9 +366,8 @@ The above example produces the following terms:
 
 The regex above is easier to understand as:
 
-[source,js]
+[source,regex]
 --------------------------------------------------
-
   ([^\p{L}\d]+)                 # swallow non letters and numbers,
 | (?<=\D)(?=\d)                 # or non-number followed by number,
 | (?<=\d)(?=\D)                 # or number followed by non-number,

+ 2 - 2
docs/reference/analysis/charfilters/htmlstrip-charfilter.asciidoc

@@ -43,14 +43,14 @@ POST _analyze
 
 The above example returns the term:
 
-[source,js]
+[source,text]
 ---------------------------
 [ \nI'm so happy!\n ]
 ---------------------------
 
 The same example with the `standard` tokenizer would return the following terms:
 
-[source,js]
+[source,text]
 ---------------------------
 [ I'm, so, happy ]
 ---------------------------

+ 4 - 3
docs/reference/analysis/charfilters/pattern-replace-charfilter.asciidoc

@@ -79,7 +79,9 @@ POST my_index/_analyze
 }
 ----------------------------
 // CONSOLE
-// TEST[skip:Test interprets $1 as a stashed variable]
+// TEST[s/\$1//]
+// the test framework doesn't like the $1 so we just throw it away rather than
+// try to get it to work properly. At least we are still testing the charfilter.
 
 The above example produces the following term:
 
@@ -88,7 +90,6 @@ The above example produces the following term:
 [ My, credit, card, is 123_456_789 ]
 ---------------------------
 
-
 WARNING: Using a replacement string that changes the length of the original
 text will work for search purposes, but will result in incorrect highlighting,
 as can be seen in the following example.
@@ -193,7 +194,7 @@ POST my_index/_analyze
 
 The above returns the following terms:
 
-[source,js]
+[source,text]
 ----------------------------
 [ the, foo, bar, baz, method ]
 ----------------------------