Skip to content

Commit

Permalink
SOLR-15327: Fix typos spread in code base (apache#65)
Browse files Browse the repository at this point in the history
* SOLR-15327: Fix typos in the code base
  • Loading branch information
eribeiro authored Apr 9, 2021
1 parent 08d7f05 commit adf9e6d
Show file tree
Hide file tree
Showing 29 changed files with 91 additions and 89 deletions.
10 changes: 6 additions & 4 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ Improvements

* SOLR-14387: SolrClient.getById() will escape comma separater within ids (Markus Schuch via Mike Drob)

* SOLR-15327: Fix typos in the code base (Edward Ribeiro via Eric Pugh)

* SOLR-10814: Add short-name feature to RuleBasedAuthz plugin (Mike Drob, Hrishikesh Gadre)

* SOLR-7683 Introduce support to identify Solr internal request types (Atri Sharma, Hrishikesh Gadre)
Expand Down Expand Up @@ -7446,7 +7448,7 @@ Other Changes

* SOLR-8787: TestAuthenticationFramework should not extend TestMiniSolrCloudCluster. (Trey Cahill via shalin)

* SOLR-9180: More comprehensive tests of psuedo-fields for RTG and SolrCloud requests (hossman)
* SOLR-9180: More comprehensive tests of pseudo-fields for RTG and SolrCloud requests (hossman)

* SOLR-7930: Comment out trappy references to example docs in elevate.xml files (Erick Erickson)

Expand Down Expand Up @@ -7842,8 +7844,8 @@ Other Changes
* SOLR-5776,SOLR-9068,SOLR-8970:
- Refactor SSLConfig so that SSLTestConfig can provide SSLContexts using a NullSecureRandom
to prevent SSL tests from blocking on entropy starved machines.
- SSLTestConfig: Alternate (psuedo random) NullSecureRandom for Constants.SUN_OS.
- SSLTestConfig: Replace NullSecureRandom w/ NotSecurePsuedoRandom.
- SSLTestConfig: Alternate (pseudo random) NullSecureRandom for Constants.SUN_OS.
- SSLTestConfig: Replace NullSecureRandom w/ NotSecurePseudoRandom.
- Change SSLTestConfig to use a keystore file that is included as a resource in the
test-framework jar so users subclassing SolrTestCaseJ4 don't need to preserve magic paths.
(hossman)
Expand Down Expand Up @@ -16553,7 +16555,7 @@ Bug Fixes
empty index. (Adrien Grand via Mark Miller)

* SOLR-2352: Fixed TermVectorComponent so that it will not fail if the fl
param contains globs or psuedo-fields (hossman)
param contains globs or pseudo-fields (hossman)

* SOLR-3541: add missing solrj dependencies to binary packages.
(Thijs Vonk via siren)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public void process(ResponseBuilder rb) throws IOException
return;
}

final IdsRequsted reqIds = IdsRequsted.parseParams(req);
final IdsRequested reqIds = IdsRequested.parseParams(req);

if (reqIds.allIds.isEmpty()) {
return;
Expand Down Expand Up @@ -967,7 +967,7 @@ public int distributedProcess(ResponseBuilder rb) throws IOException {

public int createSubRequests(ResponseBuilder rb) throws IOException {

final IdsRequsted reqIds = IdsRequsted.parseParams(rb.req);
final IdsRequested reqIds = IdsRequested.parseParams(rb.req);
if (reqIds.allIds.isEmpty()) {
return ResponseBuilder.STAGE_DONE;
}
Expand Down Expand Up @@ -1100,7 +1100,7 @@ private void addDocListToResponse(final ResponseBuilder rb, final SolrDocumentLi
assert null != docList;

final SolrQueryResponse rsp = rb.rsp;
final IdsRequsted reqIds = IdsRequsted.parseParams(rb.req);
final IdsRequested reqIds = IdsRequested.parseParams(rb.req);

if (reqIds.useSingleDocResponse) {
assert docList.size() <= 1;
Expand Down Expand Up @@ -1345,40 +1345,40 @@ public static enum Resolution {

/**
* Simple struct for tracking what ids were requested and what response format is expected
* acording to the request params
* according to the request params
*/
private final static class IdsRequsted {
private final static class IdsRequested {
/** An List (which may be empty but will never be null) of the uniqueKeys requested. */
public final List<String> allIds;
/**
* true if the params provided by the user indicate that a single doc response structure
* should be used.
* Value is meaninless if <code>ids</code> is empty.
* Value is meaningless if <code>ids</code> is empty.
*/
public final boolean useSingleDocResponse;
private IdsRequsted(List<String> allIds, boolean useSingleDocResponse) {
private IdsRequested(List<String> allIds, boolean useSingleDocResponse) {
assert null != allIds;
this.allIds = allIds;
this.useSingleDocResponse = useSingleDocResponse;
}

/**
* Parsers the <code>id</code> and <code>ids</code> params attached to the specified request object,
* and returns an <code>IdsRequsted</code> struct to use for this request.
* The <code>IdsRequsted</code> is cached in the {@link SolrQueryRequest#getContext} so subsequent
* and returns an <code>IdsRequested</code> struct to use for this request.
* The <code>IdsRequested</code> is cached in the {@link SolrQueryRequest#getContext} so subsequent
* method calls on the same request will not re-parse the params.
*/
public static IdsRequsted parseParams(SolrQueryRequest req) {
final String contextKey = IdsRequsted.class.toString() + "_PARSED_ID_PARAMS";
public static IdsRequested parseParams(SolrQueryRequest req) {
final String contextKey = IdsRequested.class.toString() + "_PARSED_ID_PARAMS";
if (req.getContext().containsKey(contextKey)) {
return (IdsRequsted)req.getContext().get(contextKey);
return (IdsRequested)req.getContext().get(contextKey);
}
final SolrParams params = req.getParams();
final String id[] = params.getParams(ID);
final String ids[] = params.getParams("ids");

if (id == null && ids == null) {
IdsRequsted result = new IdsRequsted(Collections.<String>emptyList(), true);
IdsRequested result = new IdsRequested(Collections.<String>emptyList(), true);
req.getContext().put(contextKey, result);
return result;
}
Expand All @@ -1396,7 +1396,7 @@ public static IdsRequsted parseParams(SolrQueryRequest req) {
}
// if the client specified a single id=foo, then use "doc":{
// otherwise use a standard doclist
IdsRequsted result = new IdsRequsted(allIds, (ids == null && allIds.size() <= 1));
IdsRequested result = new IdsRequested(allIds, (ids == null && allIds.size() <= 1));
req.getContext().put(contextKey, result);
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throw
subt.stop();
}

{ // Once all of our components have been prepared, check if this requset involves a SortSpec.
{ // Once all of our components have been prepared, check if this request involves a SortSpec.
// If it does, and if our request includes a cursorMark param, then parse & init the CursorMark state
// (This must happen after the prepare() of all components, because any component may have modified the SortSpec)
final SortSpec spec = rb.getSortSpec();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ boolean parseParams(StatsField sf) {
* @see Stat#countDistinct
* @see Stat#distinctValues
*/
private static final EnumSet<Stat> CALCDISTINCT_PSUEDO_STAT = EnumSet.of(Stat.countDistinct, Stat.distinctValues);
private static final EnumSet<Stat> CALCDISTINCT_PSEUDO_STAT = EnumSet.of(Stat.countDistinct, Stat.distinctValues);

/**
* The set of stats computed by default when no localparams are used to specify explicit stats
Expand Down Expand Up @@ -542,15 +542,15 @@ private void populateStatsSets() {

// if no individual stat setting use the default set
if ( ! ( statSpecifiedByLocalParam
// calcdistinct (as a local param) is a psuedo-stat, prevents default set
// calcdistinct (as a local param) is a pseudo-stat, prevents default set
|| localParams.getBool("calcdistinct", false) ) ) {
statsInResponse.addAll(DEFAULT_STATS);
}

// calcDistinct is a psuedo-stat with optional top level param default behavior
// calcDistinct is a pseudo-stat with optional top level param default behavior
// if not overridden by the specific individual stats
if (localParams.getBool("calcdistinct", topLevelCalcDistinct)) {
for (Stat stat : CALCDISTINCT_PSUEDO_STAT) {
for (Stat stat : CALCDISTINCT_PSEUDO_STAT) {
// assume true, but don't include if specific stat overrides
if (localParams.getBool(stat.name(), true)) {
statsInResponse.add(stat);
Expand Down
8 changes: 4 additions & 4 deletions solr/core/src/java/org/apache/solr/schema/FieldType.java
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ public MultiValueSelector getDefaultMultiValueSelectorForSort(SchemaField field,
* different semantics.
* <p>
* By default range queries with '*'s or nulls on either side are treated as existence queries and are created with {@link #getExistenceQuery}.
* If unbounded range queries should not be treated as existence queries for a certain fieldType, then {@link #treatUnboundedRangeAsExistence} should be overriden.
* If unbounded range queries should not be treated as existence queries for a certain fieldType, then {@link #treatUnboundedRangeAsExistence} should be overridden.
* <p>
* Sub-classes should override the {@link #getSpecializedRangeQuery} method to provide their own range query implementation.
*
Expand Down Expand Up @@ -933,8 +933,8 @@ protected Query getSpecializedRangeQuery(QParser parser, SchemaField field, Stri
* Returns a Query instance for doing existence searches for a field.
* If the field does not have docValues or norms, this method will call {@link #getSpecializedExistenceQuery}, which defaults to an unbounded rangeQuery.
* <p>
* This method should only be overriden whenever a fieldType does not support {@link org.apache.lucene.search.DocValuesFieldExistsQuery} or {@link org.apache.lucene.search.NormsFieldExistsQuery}.
* If a fieldType does not support an unbounded rangeQuery as an existenceQuery (such as <code>double</code> or <code>float</code> fields), {@link #getSpecializedExistenceQuery} should be overriden.
* This method should only be overridden whenever a fieldType does not support {@link org.apache.lucene.search.DocValuesFieldExistsQuery} or {@link org.apache.lucene.search.NormsFieldExistsQuery}.
* If a fieldType does not support an unbounded rangeQuery as an existenceQuery (such as <code>double</code> or <code>float</code> fields), {@link #getSpecializedExistenceQuery} should be overridden.
*
* @param parser The {@link org.apache.solr.search.QParser} calling the method
* @param field The {@link org.apache.solr.schema.SchemaField} of the field to search
Expand All @@ -954,7 +954,7 @@ public Query getExistenceQuery(QParser parser, SchemaField field) {
/**
* Returns a Query instance for doing existence searches for a field without certain options, such as docValues or norms.
* <p>
* This method can be overriden to implement specialized existence logic for fieldTypes.
* This method can be overridden to implement specialized existence logic for fieldTypes.
* The default query returned is an unbounded range query.
*
* @param parser The {@link org.apache.solr.search.QParser} calling the method
Expand Down
2 changes: 1 addition & 1 deletion solr/core/src/java/org/apache/solr/schema/TextField.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public SortField getSortField(SchemaField field, boolean reverse) {
// historical behavior based on how the early versions of the FieldCache
// would deal with multiple indexed terms in a singled valued field...
//
// Always use the 'min' value from the (Uninverted) "psuedo doc values"
// Always use the 'min' value from the (Uninverted) "pseudo doc values"
SortedSetSelector.Type.MIN,
reverse, SortField.STRING_FIRST, SortField.STRING_LAST);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<dynamicField name="*_srpt" type="location_rpt" indexed="true" stored="true"/>
<dynamicField name="*_i" type="int" indexed="true" stored="true"/>
<!-- for testing if score psuedofield is erroneously treated as multivalued
<!-- for testing if score pseudofield is erroneously treated as multivalued
when a matching dynamic field exists
-->
<dynamicField name="*core" type="ignored" multiValued="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@

<!-- The "RandomSortField" is not used to store or search any
data. You can declare fields of this type it in your schema
to generate psuedo-random orderings of your docs for sorting
to generate pseudo-random orderings of your docs for sorting
purposes. The ordering is generated based on the field name
and the version of the index, As long as the index version
remains unchanged, and the same field name is reused,
the ordering of the docs will be consistent.
If you want differend psuedo-random orderings of documents,
If you want different pseudo-random orderings of documents,
for the same version of the index, use a dynamicField and
change the name
-->
Expand Down
4 changes: 2 additions & 2 deletions solr/core/src/test-files/solr/collection1/conf/schema11.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@

<!-- The "RandomSortField" is not used to store or search any
data. You can declare fields of this type it in your schema
to generate psuedo-random orderings of your docs for sorting
to generate pseudo-random orderings of your docs for sorting
purposes. The ordering is generated based on the field name
and the version of the index, As long as the index version
remains unchanged, and the same field name is reused,
the ordering of the docs will be consistent.
If you want differend psuedo-random orderings of documents,
If you want different pseudo-random orderings of documents,
for the same version of the index, use a dynamicField and
change the name
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@
<dynamicField name="bar_copydest_*" type="ignored" multiValued="true"/>
<dynamicField name="*_es" type="text" indexed="true" stored="true"/>

<!-- for testing if score psuedofield is erroneously treated as multivalued
<!-- for testing if score pseudofield is erroneously treated as multivalued
when a matching dynamic field exists
-->
<dynamicField name="*core" type="ignored" multiValued="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@
name and the version of the index. As long as the index version
remains unchanged, and the same field name is reused,
the ordering of the docs will be consistent.
If you want different psuedo-random orderings of documents,
If you want different pseudo-random orderings of documents,
for the same version of the index, use a dynamicField and
change the field name in the request.
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private static void createMiniSolrCloudCluster() throws Exception {

Map<String, String> collectionProperties = new HashMap<>();
collectionProperties.put("config", "solrconfig-tlog.xml");
collectionProperties.put("schema", "schema-psuedo-fields.xml");
collectionProperties.put("schema", "schema-pseudo-fields.xml");
CollectionAdminRequest.createCollection(COLLECTION_NAME, configName, numShards, repFactor)
.setProperties(collectionProperties)
.process(cluster.getSolrClient());
Expand Down Expand Up @@ -126,7 +126,7 @@ public void testMultiValued() throws Exception {
// a multi valued field (the field value is copied first, then
// if the type lookup is done again later, we get the wrong thing). SOLR-4036

// score as psuedo field - precondition checks
// score as pseudo field - precondition checks
for (String name : new String[] {"score", "val_ss"}) {
try {
FieldResponse frsp = new Field(name, params("includeDynamic","true",
Expand All @@ -147,7 +147,7 @@ public void testMultiValued() throws Exception {

SolrDocument doc = null;

// score as psuedo field
// score as pseudo field
doc = assertSearchOneDoc(params("q","*:*", "fq", "id:42", "fl","id,score,val_ss,val2_ss"));
assertEquals("42", doc.getFieldValue("id"));
assertEquals(1.0F, doc.getFieldValue("score"));
Expand All @@ -156,7 +156,7 @@ public void testMultiValued() throws Exception {
// TODO: update this test & TestPseudoReturnFields to index docs using a (multivalued) "val_ss" instead of "ssto"
//
// that way we can first sanity check a single value in a multivalued field is returned correctly
// as a "List" of one element, *AND* then we could be testing that a (single valued) psuedo-field correctly
// as a "List" of one element, *AND* then we could be testing that a (single valued) pseudo-field correctly
// overrides that actual (real) value in a multivalued field (ie: not returning a an List)
//
// (NOTE: not doing this yet due to how it will impact most other tests, many of which are currently
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public static void createMiniSolrCloudCluster() throws Exception {

CollectionAdminRequest.createCollection(COLLECTION_NAME, configName, numShards, repFactor)
.withProperty("config", "solrconfig-tlog.xml")
.withProperty("schema", "schema-psuedo-fields.xml")
.withProperty("schema", "schema-pseudo-fields.xml")
.process(CLOUD_CLIENT);

cluster.waitForActiveCollection(COLLECTION_NAME, numShards, repFactor * numShards);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ public void testFocusQueryParser() {
assertQ(req("defType","edismax", "mm","0", "q","movies_t:Terminator 100", "qf","movies_t foo_i"),
twor);

// special psuedo-fields like _query_ and _val_
// special pseudo-fields like _query_ and _val_

// _query_ should be excluded by default
assertQ(req("defType", "edismax",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {

@BeforeClass
public static void beforeTests() throws Exception {
initCore("solrconfig-tlog.xml","schema-psuedo-fields.xml");
initCore("solrconfig-tlog.xml","schema-pseudo-fields.xml");

assertU(adoc("id", "42", "val_i", "1", "ssto", "X", "subject", "aaa"));
assertU(adoc("id", "43", "val_i", "9", "ssto", "X", "subject", "bbb"));
Expand All @@ -76,7 +76,7 @@ public void testMultiValued() throws Exception {
// a multi valued field (the field value is copied first, then
// if the type lookup is done again later, we get the wrong thing). SOLR-4036

// score as psuedo field - precondition checks
// score as pseudo field - precondition checks
for (String name : new String[] {"score", "val_ss"}) {
SchemaField sf = h.getCore().getLatestSchema().getFieldOrNull(name);
assertNotNull("Test depends on a (dynamic) field mtching '"+name+
Expand All @@ -85,7 +85,7 @@ public void testMultiValued() throws Exception {
"', schema was changed out from under us!", sf.multiValued());
}

// score as psuedo field
// score as pseudo field
assertJQ(req("q","*:*", "fq", "id:42", "fl","id,score")
,"/response/docs==[{'id':'42','score':1.0}]");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private static String intfield(final int fieldNum) {

/**
* Given a (random) field number, returns a random (integer based) value for that field.
* NOTE: The number of unique values in each field is constant acording to {@link #UNIQUE_FIELD_VALS}
* NOTE: The number of unique values in each field is constant according to {@link #UNIQUE_FIELD_VALS}
* but the precise <em>range</em> of values will vary for each unique field number, such that cross field joins
* will match fewer documents based on how far apart the field numbers are.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ private static String soloIntField(final int fieldNum) {

/**
* Given a (random) field number, returns a random (integer based) value for that field.
* NOTE: The number of unique values in each field is constant acording to {@link #UNIQUE_FIELD_VALS}
* NOTE: The number of unique values in each field is constant according to {@link #UNIQUE_FIELD_VALS}
* but the precise <em>range</em> of values will vary for each unique field number, such that cross field joins
* will match fewer documents based on how far apart the field numbers are.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
name and the version of the index. As long as the index version
remains unchanged, and the same field name is reused,
the ordering of the docs will be consistent.
If you want different psuedo-random orderings of documents,
If you want different pseudo-random orderings of documents,
for the same version of the index, use a dynamicField and
change the field name in the request.
-->
Expand Down
Loading

0 comments on commit adf9e6d

Please sign in to comment.