├── .github └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── CI.adoc ├── CONTRIBUTING.adoc ├── Jenkinsfile ├── LICENSE ├── README.adoc ├── SECURITY.adoc ├── Spring Data Solr.sonargraph ├── formatting.xml ├── mvnw ├── mvnw.cmd ├── pom.xml └── src ├── main ├── asciidoc │ ├── images │ │ ├── epub-cover.png │ │ └── epub-cover.svg │ ├── index.adoc │ ├── new-features.adoc │ ├── preface.adoc │ └── reference │ │ ├── data-solr.adoc │ │ └── misc.adoc ├── java │ └── org │ │ └── springframework │ │ └── data │ │ └── solr │ │ ├── UncategorizedSolrException.java │ │ ├── VersionUtil.java │ │ ├── config │ │ ├── SolrNamespaceHandler.java │ │ └── package-info.java │ │ ├── core │ │ ├── DefaultQueryParser.java │ │ ├── QueryParser.java │ │ ├── QueryParserBase.java │ │ ├── QueryParsers.java │ │ ├── RequestMethod.java │ │ ├── ResultHelper.java │ │ ├── SolrCallback.java │ │ ├── SolrExceptionTranslator.java │ │ ├── SolrOperations.java │ │ ├── SolrTemplate.java │ │ ├── SolrTransactionSynchronizationAdapter.java │ │ ├── SolrTransactionSynchronizationAdapterBuilder.java │ │ ├── TermsQueryParser.java │ │ ├── convert │ │ │ ├── CustomConversions.java │ │ │ ├── DateTimeConverters.java │ │ │ ├── MappingSolrConverter.java │ │ │ ├── NumberConverters.java │ │ │ ├── SolrConverter.java │ │ │ ├── SolrConverterBase.java │ │ │ ├── SolrCustomConversions.java │ │ │ ├── SolrJConverter.java │ │ │ ├── SolrjConverters.java │ │ │ └── package-info.java │ │ ├── geo │ │ │ ├── GeoConverters.java │ │ │ ├── Point.java │ │ │ └── package-info.java │ │ ├── mapping │ │ │ ├── ChildDocument.java │ │ │ ├── Dynamic.java │ │ │ ├── Indexed.java │ │ │ ├── Score.java │ │ │ ├── SimpleSolrMappingContext.java │ │ │ ├── SimpleSolrPersistentEntity.java │ │ │ ├── SimpleSolrPersistentProperty.java │ │ │ ├── SolrDocument.java │ │ │ ├── SolrMappingEventPublisher.java │ │ │ ├── SolrPersistentEntity.java │ │ │ ├── SolrPersistentProperty.java │ │ │ ├── SolrSimpleTypes.java │ │ │ └── package-info.java │ │ ├── package-info.java │ │ ├── query │ │ │ ├── AbstractFacetAndHighlightQueryDecorator.java │ │ │ ├── AbstractFacetQueryDecorator.java │ │ │ ├── AbstractFunction.java │ │ │ ├── AbstractHighlightQueryDecorator.java │ │ │ ├── AbstractQuery.java │ │ │ ├── AbstractQueryDecorator.java │ │ │ ├── AbstractValueHoldingField.java │ │ │ ├── AnyCriteria.java │ │ │ ├── CalculatedField.java │ │ │ ├── Criteria.java │ │ │ ├── Crotch.java │ │ │ ├── CurrencyFunction.java │ │ │ ├── DefaultValueFunction.java │ │ │ ├── DistanceField.java │ │ │ ├── DistanceFunction.java │ │ │ ├── DivideFunction.java │ │ │ ├── ExistsFunction.java │ │ │ ├── FacetAndHighlightQuery.java │ │ │ ├── FacetOptions.java │ │ │ ├── FacetQuery.java │ │ │ ├── Field.java │ │ │ ├── FieldWithQueryParameters.java │ │ │ ├── FilterQuery.java │ │ │ ├── Function.java │ │ │ ├── GeoDistanceFunction.java │ │ │ ├── GeoHashFunction.java │ │ │ ├── GroupOptions.java │ │ │ ├── HighlightOptions.java │ │ │ ├── HighlightQuery.java │ │ │ ├── IfFunction.java │ │ │ ├── Join.java │ │ │ ├── MaxFunction.java │ │ │ ├── Node.java │ │ │ ├── NotFunction.java │ │ │ ├── ParameterHolder.java │ │ │ ├── PartialUpdate.java │ │ │ ├── PivotField.java │ │ │ ├── ProductFunction.java │ │ │ ├── Query.java │ │ │ ├── QueryFunction.java │ │ │ ├── QueryParameter.java │ │ │ ├── QueryParameterImpl.java │ │ │ ├── QueryStringHolder.java │ │ │ ├── SimpleCalculatedField.java │ │ │ ├── SimpleFacetAndHighlightQuery.java │ │ │ ├── SimpleFacetQuery.java │ │ │ ├── SimpleField.java │ │ │ ├── SimpleFilterQuery.java │ │ │ ├── SimpleHighlightQuery.java │ │ │ ├── SimplePivotField.java │ │ │ ├── SimpleQuery.java │ │ │ ├── SimpleStringCriteria.java │ │ │ ├── SimpleTermsQuery.java │ │ │ ├── SimpleUpdateField.java │ │ │ ├── SolrDataQuery.java │ │ │ ├── SolrPageRequest.java │ │ │ ├── SpellcheckOptions.java │ │ │ ├── StatsOptions.java │ │ │ ├── TermFrequencyFunction.java │ │ │ ├── TermsOptions.java │ │ │ ├── TermsQuery.java │ │ │ ├── Update.java │ │ │ ├── UpdateAction.java │ │ │ ├── UpdateField.java │ │ │ ├── ValueHoldingField.java │ │ │ ├── package-info.java │ │ │ └── result │ │ │ │ ├── CountEntry.java │ │ │ │ ├── Cursor.java │ │ │ │ ├── DelegatingCursor.java │ │ │ │ ├── FacetAndHighlightPage.java │ │ │ │ ├── FacetEntry.java │ │ │ │ ├── FacetFieldEntry.java │ │ │ │ ├── FacetPage.java │ │ │ │ ├── FacetPivotFieldEntry.java │ │ │ │ ├── FacetQueryEntry.java │ │ │ │ ├── FacetQueryResult.java │ │ │ │ ├── FieldStatsResult.java │ │ │ │ ├── FieldValueCountEntry.java │ │ │ │ ├── GroupEntry.java │ │ │ │ ├── GroupPage.java │ │ │ │ ├── GroupResult.java │ │ │ │ ├── HighlightEntry.java │ │ │ │ ├── HighlightPage.java │ │ │ │ ├── HighlightQueryResult.java │ │ │ │ ├── PageKey.java │ │ │ │ ├── ScoredPage.java │ │ │ │ ├── SimpleFacetFieldEntry.java │ │ │ │ ├── SimpleFacetPivotEntry.java │ │ │ │ ├── SimpleFacetQueryEntry.java │ │ │ │ ├── SimpleFieldStatsResult.java │ │ │ │ ├── SimpleGroupEntry.java │ │ │ │ ├── SimpleGroupResult.java │ │ │ │ ├── SimpleStatsResult.java │ │ │ │ ├── SimpleTermsFieldEntry.java │ │ │ │ ├── SolrResultPage.java │ │ │ │ ├── SpellcheckQueryResult.java │ │ │ │ ├── SpellcheckedPage.java │ │ │ │ ├── StatsPage.java │ │ │ │ ├── StatsResult.java │ │ │ │ ├── StringPageKey.java │ │ │ │ ├── TermsEntry.java │ │ │ │ ├── TermsFieldEntry.java │ │ │ │ ├── TermsPage.java │ │ │ │ ├── TermsResultPage.java │ │ │ │ ├── ValueCountEntry.java │ │ │ │ └── package-info.java │ │ └── schema │ │ │ ├── ContentParser.java │ │ │ ├── DefaultSchemaOperations.java │ │ │ ├── MappingJacksonRequestContentParser.java │ │ │ ├── MappingJacksonResponseParser.java │ │ │ ├── SchemaDefinition.java │ │ │ ├── SchemaModificationException.java │ │ │ ├── SchemaOperations.java │ │ │ ├── SolrJsonRequest.java │ │ │ ├── SolrJsonResponse.java │ │ │ ├── SolrPersistentEntitySchemaCreator.java │ │ │ ├── SolrSchemaResolver.java │ │ │ ├── SolrSchemaWriter.java │ │ │ └── package-info.java │ │ ├── package-info.java │ │ ├── repository │ │ ├── Boost.java │ │ ├── Facet.java │ │ ├── Highlight.java │ │ ├── Pivot.java │ │ ├── Query.java │ │ ├── Score.java │ │ ├── SelectiveStats.java │ │ ├── SolrCrudRepository.java │ │ ├── SolrRepository.java │ │ ├── Spellcheck.java │ │ ├── Stats.java │ │ ├── cdi │ │ │ ├── SolrRepositoryBean.java │ │ │ ├── SolrRepositoryExtension.java │ │ │ └── package-info.java │ │ ├── config │ │ │ ├── AbstractSolrConfiguration.java │ │ │ ├── EnableSolrRepositories.java │ │ │ ├── SolrRepositoriesRegistrar.java │ │ │ ├── SolrRepositoryConfigExtension.java │ │ │ └── package-info.java │ │ ├── package-info.java │ │ ├── query │ │ │ ├── AbstractSolrQuery.java │ │ │ ├── BindableSolrParameter.java │ │ │ ├── PartTreeSolrQuery.java │ │ │ ├── SolrEntityInformation.java │ │ │ ├── SolrEntityInformationCreator.java │ │ │ ├── SolrParameter.java │ │ │ ├── SolrParameterAccessor.java │ │ │ ├── SolrParameters.java │ │ │ ├── SolrParametersParameterAccessor.java │ │ │ ├── SolrQueryCreator.java │ │ │ ├── SolrQueryMethod.java │ │ │ ├── StringBasedSolrQuery.java │ │ │ └── package-info.java │ │ └── support │ │ │ ├── MappingSolrEntityInformation.java │ │ │ ├── SimpleSolrRepository.java │ │ │ ├── SolrEntityInformationCreatorImpl.java │ │ │ ├── SolrRepositoryFactory.java │ │ │ ├── SolrRepositoryFactoryBean.java │ │ │ └── package-info.java │ │ └── server │ │ ├── SolrClientFactory.java │ │ ├── config │ │ ├── EmbeddedSolrServerBeanDefinitionParser.java │ │ ├── HttpSolrClientBeanDefinitionParser.java │ │ └── package-info.java │ │ ├── package-info.java │ │ └── support │ │ ├── EmbeddedSolrServerFactory.java │ │ ├── EmbeddedSolrServerFactoryBean.java │ │ ├── HttpSolrClientFactory.java │ │ ├── HttpSolrClientFactoryBean.java │ │ ├── SolrClientFactoryBase.java │ │ ├── SolrClientUtils.java │ │ └── package-info.java └── resources │ ├── META-INF │ ├── services │ │ └── javax.enterprise.inject.spi.Extension │ ├── spring.factories │ ├── spring.handlers │ ├── spring.schemas │ └── spring.tooling │ ├── changelog.txt │ ├── license.txt │ ├── notice.txt │ └── org │ └── springframework │ └── data │ └── solr │ └── config │ ├── spring-solr-1.0.xsd │ ├── spring-solr-2.0.xsd │ ├── spring-solr-3.0.xsd │ └── spring-solr-4.0.xsd └── test ├── java └── org │ └── springframework │ └── data │ └── solr │ ├── AbstractITestWithEmbeddedSolrServer.java │ ├── ExampleSolrBean.java │ ├── HttpSolrClientFactoryTests.java │ ├── core │ ├── DefaultQueryParserTests.java │ ├── FunctionQueryFragmentTests.java │ ├── ITestSolrTemplate.java │ ├── QueryParserBaseTests.java │ ├── QueryParsersTests.java │ ├── ResultHelperTests.java │ ├── SimpleJavaObject.java │ ├── SolrExceptionTranslatorTests.java │ ├── SolrTemplateTests.java │ ├── TermsQueryParserTests.java │ ├── convert │ │ ├── DateTimeConvertersTests.java │ │ ├── GeoConverterTests.java │ │ ├── ITestMappingSolrConverter.java │ │ ├── MappingSolrConvertDocumentObjectBinderCompatibilityTests.java │ │ ├── MappingSolrConverterTests.java │ │ ├── NumberConvertersTests.java │ │ ├── SolrJConverterTests.java │ │ └── UpdateToSolrInputDocumentConverterTests.java │ ├── mapping │ │ ├── SimpleSolrPersistentEntityTests.java │ │ ├── SimpleSolrPersistentPropertyTest.java │ │ └── SimpleSolrPersitentPropertyFieldNameTests.java │ ├── query │ │ ├── CriteriaTests.java │ │ ├── FacetOptionsTests.java │ │ ├── FieldWithQueryParametersTests.java │ │ ├── HighlightOptionsTests.java │ │ ├── ITestCriteriaExecution.java │ │ ├── PartialUpdateTests.java │ │ ├── SimpleHighlightQueryTests.java │ │ ├── SimpleQueryTests.java │ │ ├── SimpleStringCriteriaTests.java │ │ ├── StatsOptionsTests.java │ │ └── result │ │ │ ├── DelegatingCursorUnitTests.java │ │ │ ├── SimpleStatsResultTests.java │ │ │ └── SolrGroupResultPageTest.java │ └── schema │ │ ├── DefaultSchemaOperationsTests.java │ │ ├── ITestSolrSchemaCreation.java │ │ ├── ITestSolrSchemaWriter.java │ │ └── SolrSchmemaResolverUnitTests.java │ ├── repository │ ├── ExampleSolrBeanRepository.java │ ├── ITestSimpleSolrRepository.java │ ├── ITestSolrRepositoryOperations.java │ ├── ITestTransactionalSolrRepositoryDeleteOperationRollbackFalse.java │ ├── ITestTransactionalSolrRepositoryDeleteOperationRollbackTrue.java │ ├── ITestTransactionalSolrRepositorySaveOperationRollbackFalse.java │ ├── ITestTransactionalSolrRepositorySaveOperationRollbackTrue.java │ ├── ProductBean.java │ ├── ProductRepository.java │ ├── SimpleSolrRepositoryTests.java │ ├── TransactionalIntegrationTestsBase.java │ ├── cdi │ │ ├── CdiProductRepository.java │ │ ├── CdiRepositoryClient.java │ │ ├── ITestCdiRepository.java │ │ ├── SamplePersonFragment.java │ │ ├── SamplePersonFragmentImpl.java │ │ ├── SamplePersonRepository.java │ │ └── SolrTemplateProducer.java │ ├── config │ │ ├── EnableSolrRepositoriesWithPredefinedConvertersUnitTests.java │ │ ├── EnableSolrRepositoriesWithPredefinedMappingContextTests.java │ │ ├── ITestEnableSolrRepositories.java │ │ ├── ITestEnableSolrRepositoriesJustDeclaringSolrClient.java │ │ ├── ITestEnableSolrRepositoriesWithMulticoreSupport.java │ │ ├── ITestEnableSolrRepositoriesWithOptionalSolrServer.java │ │ ├── ITestEnableSolrRepositoriesWithSchemaCreationSupport.java │ │ ├── ITestXmlNamespace.java │ │ ├── Person.java │ │ ├── PersonRepository.java │ │ └── SolrRepositoryConfigExtensionUnitTests.java │ ├── query │ │ ├── SolrParameterTests.java │ │ ├── SolrParametersParameterAccessorTests.java │ │ ├── SolrQueryCreatorTests.java │ │ ├── SolrQueryMethodTests.java │ │ ├── SolrQueryTests.java │ │ └── StringBasedSolrQueryTests.java │ └── support │ │ ├── ITestSolrRepositoryFactory.java │ │ ├── MappingSolrEntityInformationTests.java │ │ └── SolrRepositoryFactoryTests.java │ └── test │ └── util │ ├── EmbeddedSolrServer.java │ └── GenericMockFactory.java └── resources ├── META-INF └── solr-named-queries.properties ├── logback.xml ├── managed-schema ├── collection1 │ ├── conf │ │ ├── currency.xml │ │ ├── elevate.xml │ │ ├── email_url_types.txt │ │ ├── lang │ │ │ ├── contractions_ca.txt │ │ │ ├── contractions_fr.txt │ │ │ ├── contractions_ga.txt │ │ │ ├── contractions_it.txt │ │ │ ├── hyphenations_ga.txt │ │ │ ├── stemdict_nl.txt │ │ │ ├── stoptags_ja.txt │ │ │ ├── stopwords_ar.txt │ │ │ ├── stopwords_bg.txt │ │ │ ├── stopwords_ca.txt │ │ │ ├── stopwords_cz.txt │ │ │ ├── stopwords_da.txt │ │ │ ├── stopwords_de.txt │ │ │ ├── stopwords_el.txt │ │ │ ├── stopwords_en.txt │ │ │ ├── stopwords_es.txt │ │ │ ├── stopwords_eu.txt │ │ │ ├── stopwords_fa.txt │ │ │ ├── stopwords_fi.txt │ │ │ ├── stopwords_fr.txt │ │ │ ├── stopwords_ga.txt │ │ │ ├── stopwords_gl.txt │ │ │ ├── stopwords_hi.txt │ │ │ ├── stopwords_hu.txt │ │ │ ├── stopwords_hy.txt │ │ │ ├── stopwords_id.txt │ │ │ ├── stopwords_it.txt │ │ │ ├── stopwords_ja.txt │ │ │ ├── stopwords_lv.txt │ │ │ ├── stopwords_nl.txt │ │ │ ├── stopwords_no.txt │ │ │ ├── stopwords_pt.txt │ │ │ ├── stopwords_ro.txt │ │ │ ├── stopwords_ru.txt │ │ │ ├── stopwords_sv.txt │ │ │ ├── stopwords_th.txt │ │ │ ├── stopwords_tr.txt │ │ │ └── userdict_ja.txt │ │ ├── managed-schema │ │ ├── params.json │ │ ├── protwords.txt │ │ ├── solrconfig.xml │ │ ├── stopwords.txt │ │ └── synonyms.txt │ └── core.properties ├── solr.xml └── zoo.cfg ├── org └── springframework │ └── data │ └── solr │ └── repository │ ├── ITestSolrRepositoryOperations-context.xml │ ├── TransactionalSolrRepositoryTest-context.xml │ └── config │ └── namespace.xml └── static-schema ├── collection1 ├── conf │ ├── clustering │ │ └── carrot2 │ │ │ ├── kmeans-attributes.xml │ │ │ ├── lingo-attributes.xml │ │ │ └── stc-attributes.xml │ ├── currency.xml │ ├── elevate.xml │ ├── lang │ │ ├── contractions_ca.txt │ │ ├── contractions_fr.txt │ │ ├── contractions_ga.txt │ │ ├── contractions_it.txt │ │ ├── hyphenations_ga.txt │ │ ├── stemdict_nl.txt │ │ ├── stoptags_ja.txt │ │ ├── stopwords_ar.txt │ │ ├── stopwords_bg.txt │ │ ├── stopwords_ca.txt │ │ ├── stopwords_ckb.txt │ │ ├── stopwords_cz.txt │ │ ├── stopwords_da.txt │ │ ├── stopwords_de.txt │ │ ├── stopwords_el.txt │ │ ├── stopwords_en.txt │ │ ├── stopwords_es.txt │ │ ├── stopwords_eu.txt │ │ ├── stopwords_fa.txt │ │ ├── stopwords_fi.txt │ │ ├── stopwords_fr.txt │ │ ├── stopwords_ga.txt │ │ ├── stopwords_gl.txt │ │ ├── stopwords_hi.txt │ │ ├── stopwords_hu.txt │ │ ├── stopwords_hy.txt │ │ ├── stopwords_id.txt │ │ ├── stopwords_it.txt │ │ ├── stopwords_ja.txt │ │ ├── stopwords_lv.txt │ │ ├── stopwords_nl.txt │ │ ├── stopwords_no.txt │ │ ├── stopwords_pt.txt │ │ ├── stopwords_ro.txt │ │ ├── stopwords_ru.txt │ │ ├── stopwords_sv.txt │ │ ├── stopwords_th.txt │ │ ├── stopwords_tr.txt │ │ └── userdict_ja.txt │ ├── managed-schema │ ├── mapping-FoldToASCII.txt │ ├── mapping-ISOLatin1Accent.txt │ ├── protwords.txt │ ├── schema.xml │ ├── scripts.conf │ ├── solrconfig.xml │ ├── spellings.txt │ ├── stopwords.txt │ └── synonyms.txt └── core.properties ├── core └── schema │ └── default_schema.json ├── solr.xml └── zoo.cfg /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 7 | 8 | - [ ] You have read the [Spring Data contribution guidelines](https://github.com/spring-projects/spring-data-build/blob/master/CONTRIBUTING.adoc). 9 | - [ ] There is a ticket in the bug tracker for the project in our [JIRA](https://jira.spring.io/browse/DATASOLR). 10 | - [ ] You use the code formatters provided [here](https://github.com/spring-projects/spring-data-build/tree/master/etc/ide) and have them applied to your changes. Don’t submit any formatting related changes. 11 | - [ ] You submit test cases (unit or integration tests) that back your changes. 12 | - [ ] You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only). 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .settings/ 3 | .project 4 | .classpath 5 | .springBeans 6 | .sonar4clipse 7 | *.sonar4clipseExternals 8 | .idea 9 | spring-data-solr.iml 10 | .DS_Store 11 | _site 12 | 13 | /bin/ 14 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-solr/33bec75de9aadad27b951a95650fc90bebdc25a7/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip -------------------------------------------------------------------------------- /CONTRIBUTING.adoc: -------------------------------------------------------------------------------- 1 | = Spring Data contribution guidelines 2 | 3 | You find the contribution guidelines for Spring Data projects https://github.com/spring-projects/spring-data-build/blob/master/CONTRIBUTING.adoc[here]. 4 | -------------------------------------------------------------------------------- /SECURITY.adoc: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Please see the https://spring.io/projects/spring-data-solr[Spring Data for Apache Solr] project page for supported versions. 6 | 7 | ## Reporting a Vulnerability 8 | 9 | Please don't raise security vulnerabilities here. Head over to https://pivotal.io/security to learn how to disclose them responsibly. 10 | -------------------------------------------------------------------------------- /src/main/asciidoc/images/epub-cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-solr/33bec75de9aadad27b951a95650fc90bebdc25a7/src/main/asciidoc/images/epub-cover.png -------------------------------------------------------------------------------- /src/main/asciidoc/index.adoc: -------------------------------------------------------------------------------- 1 | = Spring Data for Apache Solr 2 | Christoph Strobl, Oliver Gierke, Mark Pollack, Thomas Risberg, Jay Bryant 3 | :revnumber: {version} 4 | :revdate: {localdate} 5 | ifdef::backend-epub3[:front-cover-image: image:epub-cover.png[Front Cover,1050,1600]] 6 | :spring-data-commons-docs: ../../../../spring-data-commons/src/main/asciidoc 7 | 8 | (C) 2012-2019 The original author(s). 9 | 10 | NOTE: Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically. 11 | 12 | include::preface.adoc[] 13 | include::new-features.adoc[leveloffset=+1] 14 | include::{spring-data-commons-docs}/repositories.adoc[leveloffset=+1] 15 | 16 | [[reference]] 17 | = Reference Documentation 18 | 19 | include::reference/data-solr.adoc[leveloffset=+1] 20 | include::reference/misc.adoc[leveloffset=+1] 21 | 22 | [[appendix]] 23 | = Appendix 24 | 25 | :numbered!: 26 | include::{spring-data-commons-docs}/repository-namespace-reference.adoc[leveloffset=+1] 27 | include::{spring-data-commons-docs}/repository-populator-namespace-reference.adoc[leveloffset=+1] 28 | include::{spring-data-commons-docs}/repository-query-keywords-reference.adoc[leveloffset=+1] 29 | include::{spring-data-commons-docs}/repository-query-return-types-reference.adoc[v] 30 | -------------------------------------------------------------------------------- /src/main/asciidoc/new-features.adoc: -------------------------------------------------------------------------------- 1 | [[new-features]] 2 | = New & Noteworthy 3 | 4 | [[new-features.2-1-0]] 5 | == What's New in Spring Data for Apache Solr 2.1 6 | * Autoselect Solr core by using `SolrTemplate`. 7 | * Assert upwards compatibility with Apache Solr 6 (including 6.3). 8 | * Support for combined `Facet` and `Highlight` queries. 9 | * Allow reading single-valued multi-value fields into non-collection properties. 10 | * Use the native SolrJ schema API. 11 | 12 | [[new-features.2-0-0]] 13 | == What's New in Spring Data for Apache Solr 2.0 14 | * Upgrade to Apache Solr 5. 15 | * Support `RequestMethod` when querying. 16 | 17 | [[new-features.1-5-0]] 18 | == What's New in Spring Data for Apache Solr 1.5 19 | 20 | * Support for <>. 21 | * Automatically prefix and suffix map keys with `@Dynamic` (See: `dynamicMappedFieldValues` in <>). 22 | 23 | [[new-features.1-4-0]] 24 | == What's New in Spring Data for Apache Solr 1.4 25 | 26 | * Upgraded to recent Solr 4.10.x distribution (requires Java 7). 27 | * Added support for <>. 28 | * Get <> (max, min, sum, count, mean, missing, stddev and distinct calculations). 29 | * Use `@Score` to automatically add projection on the document score (See: <>). 30 | -------------------------------------------------------------------------------- /src/main/asciidoc/preface.adoc: -------------------------------------------------------------------------------- 1 | = Preface 2 | 3 | The Spring Data for Apache Solr project applies core Spring concepts to the development of solutions by using the Apache Solr Search Engine. We provide a "`template`" as a high-level abstraction for storing and querying documents. You may notice similarities to the MongoDB support in the Spring Framework. 4 | 5 | [[project]] 6 | [preface] 7 | == Project Metadata 8 | 9 | * Version Control: https://github.com/spring-projects/spring-data-solr 10 | * Bugtacker: https://jira.spring.io/browse/DATASOLR 11 | * Release repository: https://repo.spring.io/libs-release 12 | * Milestone repository: https://repo.spring.io/libs-milestone 13 | * Snapshot repository: https://repo.spring.io/libs-snapshot 14 | 15 | [[requirements]] 16 | [preface] 17 | == Requirements 18 | 19 | Spring Data Solr requires Java 8 runtime and https://lucene.apache.org/solr/[Apache Solr] 8.0. We recommend using the latest 8.0.x version. 20 | 21 | The following Maven dependency snippet shows how to include Apache Solr in your project: 22 | 23 | [source,xml] 24 | ---- 25 | 26 | org.apache.solr 27 | solr-solrj 28 | ${solr.version} 29 | 30 | ---- 31 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/UncategorizedSolrException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr; 17 | 18 | import org.springframework.dao.UncategorizedDataAccessException; 19 | 20 | /** 21 | * SolrClient threw an exception that could not be mapped. UncategorizedSolrException wraps the original Exception 22 | * 23 | * @author Christoph Strobl 24 | */ 25 | public class UncategorizedSolrException extends UncategorizedDataAccessException { 26 | 27 | private static final long serialVersionUID = -5730097613482828069L; 28 | 29 | public UncategorizedSolrException(String msg, Throwable cause) { 30 | super(msg, cause); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/VersionUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr; 17 | 18 | import org.springframework.util.ClassUtils; 19 | 20 | /** 21 | * Version util uses {@link org.springframework.util.ClassUtils#isPresent(String, ClassLoader)} to determine presence of 22 | * certain classes that are unique to some libraries, which allows to en-/disable some of the features in eg. 23 | * {@link org.springframework.data.solr.core.DefaultQueryParser}. 24 | * 25 | * @author Christoph Strobl 26 | */ 27 | public final class VersionUtil { 28 | 29 | private VersionUtil() { 30 | // hide utility class constructor 31 | } 32 | 33 | private static final boolean IS_JODATIME_AVAILABLE = ClassUtils.isPresent("org.joda.time.DateTime", 34 | VersionUtil.class.getClassLoader()); 35 | 36 | private static final boolean IS_SOLR_7 = ClassUtils.isPresent("org.apache.solr.client.solrj.V2RequestSupport", 37 | VersionUtil.class.getClassLoader()); 38 | 39 | /** 40 | * @return true if {@code org.joda.time.DateTime} is in path 41 | */ 42 | public static boolean isJodaTimeAvailable() { 43 | return IS_JODATIME_AVAILABLE; 44 | } 45 | 46 | /** 47 | * @return {@literal true} if Solr7 is on the classpath. 48 | * @since 4.0 49 | */ 50 | public static boolean isIsSolr7() { 51 | return IS_SOLR_7; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring XML namespace configuration for Solr specific repositories and SolrClient 3 | */ 4 | @org.springframework.lang.NonNullApi 5 | @org.springframework.lang.NonNullFields 6 | package org.springframework.data.solr.config; 7 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/RequestMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core; 17 | 18 | import org.apache.solr.client.solrj.SolrRequest; 19 | 20 | /** 21 | * {@literal HTTP} request types supported by {@link SolrRequest}. 22 | * 23 | * @author Shiradwade Sateesh Krishna 24 | * @author Christoph Strobl 25 | * @since 2.0 26 | */ 27 | public enum RequestMethod { 28 | 29 | GET, POST, PUT 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/SolrCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core; 17 | 18 | import java.io.IOException; 19 | 20 | import org.apache.solr.client.solrj.SolrClient; 21 | import org.apache.solr.client.solrj.SolrServerException; 22 | 23 | /** 24 | * Callback interface for data access code that works with SolrClient. To be used with {@link SolrOperations} to execute 25 | * methods. 26 | * 27 | * @param 28 | * @author Christoph Strobl 29 | */ 30 | public interface SolrCallback { 31 | 32 | /** 33 | * @param solrClient execute 34 | * @return 35 | * @throws SolrServerException 36 | * @throws IOException 37 | */ 38 | T doInSolr(SolrClient solrClient) throws SolrServerException, IOException; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/convert/CustomConversions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.convert; 17 | 18 | import java.util.ArrayList; 19 | import java.util.List; 20 | 21 | import org.springframework.core.convert.converter.Converter; 22 | import org.springframework.data.convert.ReadingConverter; 23 | import org.springframework.data.convert.WritingConverter; 24 | 25 | /** 26 | * CustomConversions holds basically a list of {@link Converter} that can be used for mapping objects to ( 27 | * {@link WritingConverter}) and from ({@link ReadingConverter}) solr representation. 28 | * 29 | * @author Christoph Strobl 30 | * @author Rias A. Sherzad 31 | * @author Mark Paluch 32 | * @deprecated since 2.0, use {@link SolrCustomConversions}. 33 | */ 34 | @Deprecated 35 | public class CustomConversions extends SolrCustomConversions { 36 | 37 | /** 38 | * Create new instance 39 | */ 40 | public CustomConversions() { 41 | this(new ArrayList<>()); 42 | } 43 | 44 | /** 45 | * Create new instance registering given converters 46 | * 47 | * @param converters 48 | */ 49 | @SuppressWarnings({ "unchecked", "rawtypes" }) 50 | public CustomConversions(List converters) { 51 | super(converters); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/convert/NumberConverters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.convert; 17 | 18 | import org.springframework.core.convert.converter.Converter; 19 | import org.springframework.data.convert.WritingConverter; 20 | import org.springframework.util.Assert; 21 | 22 | /** 23 | * Converts a Number values into a solr readable String that can be directly used within the {@code q} parameter. 24 | * Negative values will be escaped accordingly. 25 | * 26 | * @author Christoph Strobl 27 | */ 28 | public final class NumberConverters { 29 | 30 | @WritingConverter 31 | public enum NumberConverter implements Converter { 32 | INSTANCE; 33 | 34 | @Override 35 | public String convert(Number source) { 36 | 37 | Assert.notNull(source, "Source must not be null"); 38 | 39 | if (source.doubleValue() < 0d) { 40 | return "\\" + source.toString(); 41 | } 42 | return source.toString(); 43 | } 44 | 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/convert/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All the {@link org.springframework.core.convert.converter.Converter}s go here. 3 | */ 4 | @org.springframework.lang.NonNullApi 5 | @org.springframework.lang.NonNullFields 6 | package org.springframework.data.solr.core.convert; 7 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/geo/Point.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.geo; 17 | 18 | import org.springframework.lang.Nullable; 19 | 20 | /** 21 | * @author Christoph Strobl 22 | * @since 1.1 23 | */ 24 | public class Point extends org.springframework.data.geo.Point { 25 | 26 | private @Nullable Double z; 27 | 28 | public Point(double x, double y) { 29 | super(x, y); 30 | } 31 | 32 | public Point(double x, double y, double z) { 33 | super(x, y); 34 | this.z = z; 35 | } 36 | 37 | @Nullable 38 | public Double getZ() { 39 | return z; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/geo/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Apache Solr geo specifics. 3 | */ 4 | @org.springframework.lang.NonNullApi 5 | @org.springframework.lang.NonNullFields 6 | package org.springframework.data.solr.core.geo; 7 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/mapping/ChildDocument.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017. the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.mapping; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Marker interface for Apache Solr child document can be used as an alternative to 26 | * {@link org.apache.solr.client.solrj.beans.Field#child()}. 27 | * 28 | * @author Christoph Strobl 29 | * @since 3.0 30 | */ 31 | @Retention(RetentionPolicy.RUNTIME) 32 | @Target(ElementType.FIELD) 33 | @Documented 34 | @Indexed 35 | public @interface ChildDocument { 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/mapping/Score.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.mapping; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | import org.springframework.data.annotation.ReadOnlyProperty; 25 | 26 | /** 27 | * Defines the annotated field to store the score of a document within search result. 28 | * 29 | * @author Christoph Strobl 30 | * @since 4.0 31 | */ 32 | @ReadOnlyProperty 33 | @Documented 34 | @Retention(RetentionPolicy.RUNTIME) 35 | @Target(ElementType.FIELD) 36 | public @interface Score { 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/mapping/SolrDocument.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.mapping; 17 | 18 | import java.lang.annotation.ElementType; 19 | import java.lang.annotation.Inherited; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | import org.apache.solr.common.params.SolrParams; 25 | import org.springframework.core.annotation.AliasFor; 26 | import org.springframework.data.annotation.Persistent; 27 | 28 | /** 29 | * @author Christoph Strobl 30 | */ 31 | @Persistent 32 | @Inherited 33 | @Retention(RetentionPolicy.RUNTIME) 34 | @Target({ ElementType.TYPE }) 35 | public @interface SolrDocument { 36 | 37 | /** 38 | * Defines the {@literal collectionname} the document is persisted in. 39 | * 40 | * @return 41 | * @deprecated since 3.0. Please use {@link #collection()}. 42 | */ 43 | @Deprecated 44 | @AliasFor(attribute = "collection") 45 | String solrCoreName() default ""; 46 | 47 | /** 48 | * @return 49 | * @since 3.0 50 | */ 51 | @AliasFor(attribute = "solrCoreName") 52 | String collection() default ""; 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/mapping/SolrSimpleTypes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.mapping; 17 | 18 | import java.math.BigInteger; 19 | import java.util.Collections; 20 | import java.util.HashSet; 21 | import java.util.Set; 22 | 23 | import org.apache.solr.common.SolrInputDocument; 24 | import org.springframework.data.mapping.model.SimpleTypeHolder; 25 | 26 | /** 27 | * Set of type that do not need to be converted into a solr readable format 28 | * 29 | * @author Christoph Strobl 30 | */ 31 | public class SolrSimpleTypes { 32 | 33 | private SolrSimpleTypes() { 34 | // hide utility class constructor 35 | } 36 | 37 | static { 38 | Set> simpleTypes = new HashSet<>(); 39 | simpleTypes.add(BigInteger.class); 40 | simpleTypes.add(SolrInputDocument.class); 41 | 42 | SOLR_SIMPLE_TYPES = Collections.unmodifiableSet(simpleTypes); 43 | } 44 | 45 | private static final Set> SOLR_SIMPLE_TYPES; 46 | 47 | public static final SimpleTypeHolder HOLDER = new SimpleTypeHolder(SOLR_SIMPLE_TYPES, true); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/mapping/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All the mapping things! 3 | */ 4 | @org.springframework.lang.NonNullApi 5 | @org.springframework.lang.NonNullFields 6 | package org.springframework.data.solr.core.mapping; 7 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides the classes necessary for Solr support. 3 | * {@link org.springframework.data.solr.core.SolrTemplate} is the main entry point for accessing solr. 4 | */ 5 | @org.springframework.lang.NonNullApi 6 | @org.springframework.lang.NonNullFields 7 | package org.springframework.data.solr.core; 8 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/AbstractFacetQueryDecorator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | /** 19 | * General purpose {@link FacetQuery} decorator. 20 | * 21 | * @author Francisco Spaeth 22 | * @since 1.4 23 | */ 24 | public abstract class AbstractFacetQueryDecorator extends AbstractQueryDecorator implements FacetQuery { 25 | 26 | private FacetQuery query; 27 | 28 | public AbstractFacetQueryDecorator(FacetQuery query) { 29 | super(query); 30 | this.query = query; 31 | } 32 | 33 | @Override 34 | public T setFacetOptions(FacetOptions facetOptions) { 35 | return query.setFacetOptions(facetOptions); 36 | } 37 | 38 | @Override 39 | public FacetOptions getFacetOptions() { 40 | return query.getFacetOptions(); 41 | } 42 | 43 | @Override 44 | public boolean hasFacetOptions() { 45 | return query.hasFacetOptions(); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/AbstractHighlightQueryDecorator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | /** 19 | * General purpose {@link HighlightQuery} decorator. 20 | * 21 | * @author Francisco Spaeth 22 | * @since 1.4 23 | */ 24 | public class AbstractHighlightQueryDecorator extends AbstractQueryDecorator implements HighlightQuery { 25 | 26 | private HighlightQuery query; 27 | 28 | public AbstractHighlightQueryDecorator(HighlightQuery query) { 29 | 30 | super(query); 31 | this.query = query; 32 | } 33 | 34 | @SuppressWarnings("unchecked") 35 | @Override 36 | public T setHighlightOptions(HighlightOptions highlightOptions) { 37 | return (T) this; 38 | } 39 | 40 | @Override 41 | public HighlightOptions getHighlightOptions() { 42 | return query.getHighlightOptions(); 43 | } 44 | 45 | @Override 46 | public boolean hasHighlightOptions() { 47 | return query.hasHighlightOptions(); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/AbstractValueHoldingField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import org.springframework.lang.Nullable; 19 | 20 | /** 21 | * Base implementation of {@link ValueHoldingField}
22 | * 23 | * @author Christoph Strobl 24 | */ 25 | class AbstractValueHoldingField extends SimpleField implements ValueHoldingField { 26 | 27 | private @Nullable Object value; 28 | 29 | protected AbstractValueHoldingField(String fieldName) { 30 | super(fieldName); 31 | } 32 | 33 | protected AbstractValueHoldingField(String fieldName, Object fieldValue) { 34 | this(fieldName); 35 | this.value = fieldValue; 36 | } 37 | 38 | @Nullable 39 | @Override 40 | public Object getValue() { 41 | return this.value; 42 | } 43 | 44 | public void setValue(@Nullable Object value) { 45 | this.value = value; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/AnyCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import org.springframework.util.ObjectUtils; 19 | 20 | /** 21 | * @author Christoph Strobl 22 | * @since 2.1 23 | */ 24 | public final class AnyCriteria extends Criteria implements QueryStringHolder { 25 | 26 | private static final String QUERY_STRING = "*:*"; 27 | 28 | private AnyCriteria() { 29 | 30 | } 31 | 32 | public static Criteria any() { 33 | return new AnyCriteria(); 34 | } 35 | 36 | @Override 37 | public String getQueryString() { 38 | return QUERY_STRING; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | return getQueryString(); 44 | } 45 | 46 | @Override 47 | public boolean equals(Object obj) { 48 | 49 | return obj instanceof AnyCriteria && ObjectUtils.nullSafeEquals(QUERY_STRING, ((AnyCriteria) obj).getQueryString()); 50 | } 51 | 52 | @Override 53 | public int hashCode() { 54 | return ObjectUtils.nullSafeHashCode(QUERY_STRING); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/CalculatedField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | 19 | /** 20 | * @author Christoph Strobl 21 | * @since 1.1 22 | */ 23 | public interface CalculatedField extends Field { 24 | 25 | Function getFunction(); 26 | 27 | String getAlias(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/FacetAndHighlightQuery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | /** 19 | * A Query that combines a {@link FacetQuery} and a {@link HighlightQuery} 20 | * 21 | * @author David Webb 22 | * @since 2.1.0 23 | */ 24 | public interface FacetAndHighlightQuery extends FacetQuery, HighlightQuery { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/FacetQuery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import org.springframework.lang.Nullable; 19 | 20 | /** 21 | * Query to be used for faceting. 22 | * 23 | * @author Christoph Strobl 24 | */ 25 | public interface FacetQuery extends Query { 26 | 27 | /** 28 | * Faceting options to apply when executing query 29 | * 30 | * @param facetOptions 31 | * @return 32 | */ 33 | T setFacetOptions(FacetOptions facetOptions); 34 | 35 | /** 36 | * @return null if not set 37 | */ 38 | @Nullable 39 | FacetOptions getFacetOptions(); 40 | 41 | /** 42 | * @return true if options set 43 | */ 44 | boolean hasFacetOptions(); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/FilterQuery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import org.springframework.data.geo.Point; 19 | 20 | /** 21 | * Filter Queries are simple solr Queries applied after executing the original query. This corresponds to the {@code fq} 22 | * Parameter within solr. 23 | * 24 | * @author Christoph Strobl 25 | */ 26 | public interface FilterQuery extends SolrDataQuery { 27 | 28 | /** 29 | * Create a new {@link FilterQuery} with the given {@link Criteria}. 30 | * 31 | * @param criteria must not be {@literal null}. 32 | * @return new instance of {@link FilterQuery}. 33 | * @since 4.1 34 | */ 35 | static FilterQuery filter(Criteria criteria) { 36 | return new SimpleFilterQuery(criteria); 37 | } 38 | 39 | /** 40 | * Create a new {@link FilterQuery} applying a {@code geodist} function. 41 | * 42 | * @param from must not be {@literal null}. 43 | * @param to must not be {@literal null}. 44 | * @return new instance of {@link FilterQuery}. 45 | * @since 4.1 46 | */ 47 | static FilterQuery geoFilter(String from, Point to) { 48 | return filter(Criteria.where(GeoDistanceFunction.distanceFrom(from).to(to))); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/GeoHashFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import java.util.Collections; 19 | 20 | import org.springframework.data.geo.Point; 21 | import org.springframework.util.Assert; 22 | 23 | /** 24 | * Implementation of {@code geohash(latitude, longitude)} 25 | * 26 | * @author Christoph Strobl 27 | * @since 1.1 28 | */ 29 | public class GeoHashFunction extends AbstractFunction { 30 | 31 | private static final String OPERATION = "geohash"; 32 | 33 | private GeoHashFunction(Point location) { 34 | super(Collections.singletonList(location)); 35 | } 36 | 37 | /** 38 | * @param location must not be null 39 | * @return 40 | */ 41 | public static GeoHashFunction geohash(Point location) { 42 | 43 | Assert.notNull(location, "Location for geohash function must not be 'null'"); 44 | return new GeoHashFunction(location); 45 | } 46 | 47 | /** 48 | * @param latitude 49 | * @param longitude 50 | * @return 51 | */ 52 | public static GeoHashFunction geohash(double latitude, double longitude) { 53 | return geohash(new Point(latitude, longitude)); 54 | } 55 | 56 | @Override 57 | public String getOperation() { 58 | return OPERATION; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/HighlightQuery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import org.springframework.lang.Nullable; 19 | 20 | /** 21 | * @author Christoph Strobl 22 | */ 23 | public interface HighlightQuery extends Query { 24 | 25 | /** 26 | * Highlight options to apply when exectuing query 27 | * 28 | * @param highlightOptions 29 | * @return 30 | */ 31 | T setHighlightOptions(HighlightOptions highlightOptions); 32 | 33 | /** 34 | * @return null if not set 35 | */ 36 | @Nullable 37 | HighlightOptions getHighlightOptions(); 38 | 39 | /** 40 | * @return true if options set 41 | */ 42 | boolean hasHighlightOptions(); 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/PivotField.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.solr.core.query; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Defines a field that could be used within a pivot facet query. 7 | * 8 | * @author Francisco Spaeth 9 | * 10 | */ 11 | public interface PivotField extends Field { 12 | 13 | /** 14 | * Get the fields for this pivot. 15 | * 16 | * @return 17 | */ 18 | List getFields(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/QueryParameter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import org.springframework.lang.Nullable; 19 | 20 | /** 21 | * Query Parameter to be used when executing query against solr server 22 | * 23 | * @author Christoph Strobl 24 | */ 25 | public interface QueryParameter { 26 | 27 | /** 28 | * @return 29 | */ 30 | String getName(); 31 | 32 | /** 33 | * @return null if not set 34 | */ 35 | @Nullable 36 | Object getValue(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/QueryStringHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | /** 19 | * Class holding a solr readable QueryString that can be used with the {@code q} parameter. 20 | * 21 | * @author Christoph Strobl 22 | */ 23 | public interface QueryStringHolder { 24 | 25 | /** 26 | * Get the the query string to use 27 | * 28 | * @return 29 | */ 30 | String getQueryString(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/SimpleCalculatedField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import org.springframework.lang.Nullable; 19 | import org.springframework.util.Assert; 20 | 21 | /** 22 | * @author Christoph Strobl 23 | * @since 1.1 24 | */ 25 | public class SimpleCalculatedField implements CalculatedField { 26 | 27 | private Function function; 28 | private String alias; 29 | 30 | public SimpleCalculatedField(Function function) { 31 | this(null, function); 32 | } 33 | 34 | public SimpleCalculatedField(@Nullable String alias, Function function) { 35 | Assert.notNull(function, "Function cannot be empty"); 36 | 37 | this.alias = alias; 38 | this.function = function; 39 | } 40 | 41 | @Override 42 | public String getName() { 43 | return this.alias; 44 | } 45 | 46 | @Override 47 | public Function getFunction() { 48 | return this.function; 49 | } 50 | 51 | @Override 52 | public String getAlias() { 53 | return this.alias; 54 | } 55 | 56 | public void setAlias(String alias) { 57 | this.alias = alias; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/SimpleField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import org.springframework.util.ObjectUtils; 19 | 20 | /** 21 | * The most trivial implementation of a Field 22 | * 23 | * @author Christoph Strobl 24 | * @author Francisco Spaeth 25 | */ 26 | public class SimpleField implements Field { 27 | 28 | private final String name; 29 | 30 | public SimpleField(String name) { 31 | this.name = name; 32 | } 33 | 34 | @Override 35 | public String getName() { 36 | return this.name; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return this.name; 42 | } 43 | 44 | @Override 45 | public int hashCode() { 46 | return ObjectUtils.nullSafeHashCode(this.name); 47 | } 48 | 49 | @Override 50 | public boolean equals(Object other) { 51 | if (this == other) { 52 | return true; 53 | } 54 | if (!(other instanceof SimpleField)) { 55 | return false; 56 | } 57 | SimpleField that = (SimpleField) other; 58 | return ObjectUtils.nullSafeEquals(this.name, that.name); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/SimpleFilterQuery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | /** 19 | * Trivial implementation of {@link FilterQuery} 20 | * 21 | * @author Christoph Strobl 22 | */ 23 | public class SimpleFilterQuery extends AbstractQuery implements FilterQuery { 24 | 25 | public SimpleFilterQuery() {} 26 | 27 | public SimpleFilterQuery(Criteria criteria) { 28 | super(criteria); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/SimpleHighlightQuery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import org.springframework.data.domain.Pageable; 19 | import org.springframework.lang.Nullable; 20 | 21 | /** 22 | * Trivial implementation of {@link HighlightQuery} extending {@link SimpleQuery}. 23 | * 24 | * @author Christoph Strobl 25 | */ 26 | public class SimpleHighlightQuery extends SimpleQuery implements HighlightQuery { 27 | 28 | private @Nullable HighlightOptions highlightOptions; 29 | 30 | public SimpleHighlightQuery() { 31 | super(); 32 | } 33 | 34 | public SimpleHighlightQuery(Criteria criteria, @Nullable Pageable pageable) { 35 | super(criteria, pageable); 36 | } 37 | 38 | public SimpleHighlightQuery(Criteria criteria) { 39 | super(criteria); 40 | } 41 | 42 | @SuppressWarnings("unchecked") 43 | @Override 44 | public T setHighlightOptions(HighlightOptions highlightOptions) { 45 | this.highlightOptions = highlightOptions; 46 | return (T) this; 47 | } 48 | 49 | @Nullable 50 | @Override 51 | public HighlightOptions getHighlightOptions() { 52 | return this.highlightOptions; 53 | } 54 | 55 | @Override 56 | public boolean hasHighlightOptions() { 57 | return this.highlightOptions != null; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/SimpleStringCriteria.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | /** 19 | * The most basic criteria holding an already formatted QueryString that can be executed 'as is' against the solr server 20 | * 21 | * @author Christoph Strobl 22 | */ 23 | public class SimpleStringCriteria extends Criteria implements QueryStringHolder { 24 | 25 | private final String queryString; 26 | 27 | /** 28 | * @param queryString 29 | */ 30 | public SimpleStringCriteria(String queryString) { 31 | this.queryString = queryString; 32 | } 33 | 34 | @Override 35 | public String getQueryString() { 36 | return this.queryString; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return getQueryString(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/SimpleUpdateField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import org.springframework.lang.Nullable; 19 | 20 | /** 21 | * Implementation of {@link UpdateField} to be used with {@link Update} 22 | * 23 | * @author Christoph Strobl 24 | */ 25 | public class SimpleUpdateField extends AbstractValueHoldingField implements UpdateField { 26 | 27 | private static final UpdateAction DEFAULT_ACTION = UpdateAction.SET; 28 | private UpdateAction action; 29 | 30 | public SimpleUpdateField(String name) { 31 | this(name, null); 32 | } 33 | 34 | /** 35 | * Creates new instance with {@link #DEFAULT_ACTION} 36 | * 37 | * @param name 38 | * @param value 39 | */ 40 | public SimpleUpdateField(String name, @Nullable Object value) { 41 | this(name, value, DEFAULT_ACTION); 42 | } 43 | 44 | /** 45 | * @param name 46 | * @param value 47 | * @param action 48 | */ 49 | public SimpleUpdateField(String name, @Nullable Object value, UpdateAction action) { 50 | super(name, value); 51 | this.action = action; 52 | } 53 | 54 | @Override 55 | public UpdateAction getAction() { 56 | return this.action != null ? this.action : DEFAULT_ACTION; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/SolrDataQuery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import org.springframework.lang.Nullable; 19 | 20 | /** 21 | * Common interface for any Query 22 | * 23 | * @author Christoph Strobl 24 | */ 25 | public interface SolrDataQuery { 26 | 27 | /** 28 | * Append criteria to query. Criteria must not be null, nor point to a field with null value. 29 | * 30 | * @param criteria 31 | * @return 32 | */ 33 | T addCriteria(Criteria criteria); 34 | 35 | /** 36 | * @return 37 | */ 38 | @Nullable 39 | Criteria getCriteria(); 40 | 41 | /** 42 | * Set values for join {@code !join from=inner_id to=outer_id} 43 | */ 44 | void setJoin(Join join); 45 | 46 | /** 47 | * @return 48 | */ 49 | @Nullable 50 | Join getJoin(); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/TermsQuery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import java.util.List; 19 | 20 | /** 21 | * @author Christoph Strobl 22 | */ 23 | public interface TermsQuery extends SolrDataQuery { 24 | 25 | /** 26 | * @return null if not set 27 | */ 28 | TermsOptions getTermsOptions(); 29 | 30 | /** 31 | * @return fields included 32 | */ 33 | List getTermsFields(); 34 | 35 | /** 36 | * Returns the request handler. 37 | */ 38 | String getRequestHandler(); 39 | 40 | /** 41 | * Sets the request handler. 42 | */ 43 | void setRequestHandler(String requestHandler); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/Update.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import org.springframework.lang.Nullable; 19 | 20 | /** 21 | * Update one or more fields of a Document without touching the others. 22 | * 23 | * @author Christoph Strobl 24 | */ 25 | public interface Update { 26 | 27 | /** 28 | * get id field of document to update 29 | * 30 | * @return 31 | */ 32 | ValueHoldingField getIdField(); 33 | 34 | /** 35 | * List of fields and values to update 36 | * 37 | * @return 38 | */ 39 | Iterable getUpdates(); 40 | 41 | /** 42 | * Document Version {@code _version_} 43 | * 44 | * @return 45 | */ 46 | @Nullable 47 | Object getVersion(); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/UpdateAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | /** 19 | * Actions to be performed during an atomic field update. 20 | * 21 | * @author Christoph Strobl 22 | */ 23 | public enum UpdateAction { 24 | ADD("add"), INC("inc"), SET("set"); 25 | 26 | private String solrOperation; 27 | 28 | UpdateAction(String solrOperation) { 29 | this.solrOperation = solrOperation; 30 | } 31 | 32 | public String getSolrOperation() { 33 | return this.solrOperation; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/UpdateField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | /** 19 | * @author Christoph Strobl 20 | */ 21 | public interface UpdateField extends ValueHoldingField { 22 | 23 | /** 24 | * {@link UpdateAction} to perform during update 25 | * 26 | * @return 27 | */ 28 | UpdateAction getAction(); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/ValueHoldingField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import org.springframework.lang.Nullable; 19 | 20 | /** 21 | * @author Christoph Strobl 22 | */ 23 | public interface ValueHoldingField extends Field { 24 | 25 | /** 26 | * Get value for field 27 | * 28 | * @return can be {@literal null}. 29 | */ 30 | @Nullable 31 | Object getValue(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Query abstractions for {@link org.apache.solr.client.solrj.SolrQuery}. 3 | */ 4 | @org.springframework.lang.NonNullApi 5 | @org.springframework.lang.NonNullFields 6 | package org.springframework.data.solr.core.query; 7 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/CountEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | /** 19 | * @author Christoph Strobl 20 | * 21 | */ 22 | public interface CountEntry { 23 | 24 | /** 25 | * The nr of hits for the value 26 | * 27 | * @return 28 | */ 29 | long getValueCount(); 30 | 31 | /** 32 | * The value within the field 33 | * 34 | * @return 35 | */ 36 | String getValue(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/Cursor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import java.io.Closeable; 19 | import java.io.Serializable; 20 | import java.util.Iterator; 21 | 22 | import org.springframework.lang.Nullable; 23 | 24 | /** 25 | * {@link Cursor} provides a lazy loading abstraction for fetching documents. 26 | * 27 | * @author Christoph Strobl 28 | * @param 29 | */ 30 | public interface Cursor extends Iterator, Closeable { 31 | 32 | enum State { 33 | 34 | /** 35 | * @deprecated since 3.1. Please use READY instead. 36 | */ 37 | @Deprecated 38 | REDAY, READY, OPEN, FINISHED, CLOSED 39 | } 40 | 41 | /** 42 | * Get the current set cursorMark 43 | * 44 | * @return 45 | */ 46 | @Nullable 47 | Serializable getCursorMark(); 48 | 49 | /** 50 | * Opens the cursor.
51 | * Only {@link State#READY} cursors can be opened. 52 | * 53 | * @return 54 | */ 55 | Cursor open(); 56 | 57 | /** 58 | * @return the current position starting a zero. 59 | */ 60 | long getPosition(); 61 | 62 | /** 63 | * @return true if {@link State#OPEN} 64 | */ 65 | boolean isOpen(); 66 | 67 | /** 68 | * @return true if {@link State#CLOSED} 69 | */ 70 | boolean isClosed(); 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/FacetAndHighlightPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import org.springframework.data.domain.Page; 19 | 20 | /** 21 | * {@link FacetAndHighlightPage} holds a page for each field targeted by the facet query, each highlight returned by the 22 | * highlight query as well as the page values returned by the solr query 23 | * 24 | * @param 25 | * @author David Webb 26 | * @since 2.1.0 27 | */ 28 | public interface FacetAndHighlightPage extends HighlightQueryResult, FacetQueryResult, Page { 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/FacetEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | /** 19 | * FacetEntry is returned as result of a FacetQuery holding the key (eg. fieldname, query,...), value and valueCount for 20 | * the requested facet 21 | * 22 | * @author Christoph Strobl 23 | */ 24 | public interface FacetEntry extends CountEntry { 25 | 26 | /** 27 | * The key of the facetEntry 28 | * 29 | * @return 30 | */ 31 | Object getKey(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/FacetFieldEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import org.springframework.data.solr.core.query.Field; 19 | 20 | /** 21 | * Entry for facet on field 22 | * 23 | * @author Christoph Strobl 24 | */ 25 | public interface FacetFieldEntry extends FacetEntry { 26 | 27 | @Override 28 | Field getKey(); 29 | 30 | /** 31 | * get the associated Field 32 | * 33 | * @return 34 | */ 35 | Field getField(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/FacetPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import org.springframework.data.domain.Page; 19 | 20 | /** 21 | * FacetPage holds a page for each field targeted by the facet query as well as the page values returned by facet.query 22 | * 23 | * @param 24 | * @author Christoph Strobl 25 | * @author Francisco Spaeth 26 | * @author David Webb 27 | */ 28 | public interface FacetPage extends FacetQueryResult, Page { 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/FacetPivotFieldEntry.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.solr.core.query.result; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Entry for facet pivot field. 7 | * 8 | * @author Francisco Spaeth 9 | * 10 | */ 11 | public interface FacetPivotFieldEntry extends FacetFieldEntry { 12 | 13 | /** 14 | * Get the associated pivot to this {@link FacetFieldEntry}. 15 | * 16 | * @return 17 | */ 18 | List getPivot(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/FacetQueryEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import org.springframework.data.solr.core.query.FilterQuery; 19 | 20 | /** 21 | * Facet Entry for facet via query 22 | * 23 | * @author Christoph Strobl 24 | */ 25 | public interface FacetQueryEntry extends FacetEntry { 26 | 27 | @Override 28 | String getKey(); 29 | 30 | /** 31 | * get the associated Query 32 | * 33 | * @return 34 | */ 35 | FilterQuery getQuery(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/FieldValueCountEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import org.springframework.data.solr.core.query.Field; 19 | import org.springframework.data.solr.core.query.SimpleField; 20 | import org.springframework.lang.Nullable; 21 | 22 | /** 23 | * @author Christoph Strobl 24 | */ 25 | public class FieldValueCountEntry extends ValueCountEntry { 26 | 27 | private @Nullable Field field; 28 | 29 | public FieldValueCountEntry(String value, long valueCount) { 30 | super(value, valueCount); 31 | } 32 | 33 | @Nullable 34 | public Field getKey() { 35 | return getField(); 36 | } 37 | 38 | @Nullable 39 | public Field getField() { 40 | return this.field; 41 | } 42 | 43 | public final void setField(Field field) { 44 | this.field = field; 45 | } 46 | 47 | public final void setField(String fieldname) { 48 | setField(new SimpleField(fieldname)); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/GroupEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import org.springframework.data.domain.Page; 19 | 20 | /** 21 | * Representation of a group in a {@link GroupResult}. 22 | * 23 | * @author Francisco Spaeth 24 | * @param result content type 25 | * @since 1.4 26 | */ 27 | public interface GroupEntry { 28 | 29 | /** 30 | * Group name, the value on which the results were grouped by. 31 | * 32 | * @return 33 | */ 34 | String getGroupValue(); 35 | 36 | /** 37 | * Results for the current group. 38 | * 39 | * @return 40 | */ 41 | Page getResult(); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/GroupResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import org.springframework.data.domain.Page; 19 | 20 | /** 21 | * Representation of a group in response to group request (i.e. , , ) will have a {@link GroupResult} representation. 22 | * 23 | * @author Francisco Spaeth 24 | * @param grouped content type 25 | * @since 1.4 26 | */ 27 | public interface GroupResult { 28 | 29 | /** 30 | * Matched documents for this group. 31 | * 32 | * @return 33 | */ 34 | int getMatches(); 35 | 36 | /** 37 | * Groups count. 38 | * 39 | * @return 40 | */ 41 | Integer getGroupsCount(); 42 | 43 | /** 44 | * Grouping result name. 45 | * 46 | * @return 47 | */ 48 | String getName(); 49 | 50 | /** 51 | * Group entries. 52 | * 53 | * @see GroupEntry 54 | * @return 55 | */ 56 | Page> getGroupEntries(); 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/HighlightPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import org.springframework.data.domain.Page; 19 | 20 | /** 21 | * HighlightPage holds a page for each field targeted by the highlight query as well as the page values returned by the 22 | * solr query 23 | * 24 | * @param 25 | * @author Christoph Strobl 26 | * @author David Webb 27 | */ 28 | public interface HighlightPage extends HighlightQueryResult, Page { 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/HighlightQueryResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import java.util.List; 19 | 20 | import org.springframework.data.solr.core.query.result.HighlightEntry.Highlight; 21 | 22 | /** 23 | * Hold the results of a solr highlight query. 24 | * 25 | * @param 26 | * @author David Webb 27 | * @since 2.1 28 | */ 29 | public interface HighlightQueryResult { 30 | 31 | /** 32 | * @return empty list of not set 33 | */ 34 | List> getHighlighted(); 35 | 36 | /** 37 | * @param entity 38 | * @return empty list if none found 39 | */ 40 | List getHighlights(T entity); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/PageKey.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import org.springframework.lang.Nullable; 19 | 20 | /** 21 | * @author Christoph Strobl 22 | */ 23 | public interface PageKey { 24 | 25 | /** 26 | * Key to represent on page within a collection 27 | * 28 | * @return 29 | */ 30 | Object getKey(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/ScoredPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import org.springframework.data.domain.Page; 19 | import org.springframework.lang.Nullable; 20 | 21 | /** 22 | * Specific type of {@link Page} holding max score information. 23 | * 24 | * @author Francisco Spaeth 25 | * @since 1.2 26 | */ 27 | public interface ScoredPage extends Page { 28 | 29 | /** 30 | * Returns the scoring of the topmost document (max score). 31 | * 32 | * @return 33 | */ 34 | @Nullable 35 | Float getMaxScore(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/SimpleFacetFieldEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import org.springframework.data.solr.core.query.Field; 19 | 20 | /** 21 | * The most trivial implementation of {@link FacetFieldEntry} 22 | * 23 | * @author Christoph Strobl 24 | */ 25 | public class SimpleFacetFieldEntry extends FieldValueCountEntry implements FacetFieldEntry { 26 | 27 | public SimpleFacetFieldEntry(Field field, String value, long count) { 28 | super(value, count); 29 | setField(field); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/SimpleFacetPivotEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import java.util.Collections; 19 | import java.util.List; 20 | 21 | import org.springframework.data.solr.core.query.Field; 22 | import org.springframework.util.Assert; 23 | 24 | /** 25 | * The most trivial implementation of {@link FacetPivotFieldEntry}. 26 | * 27 | * @author Francisco Spaeth 28 | * @author Christoph Strobl 29 | */ 30 | public class SimpleFacetPivotEntry extends FieldValueCountEntry implements FacetPivotFieldEntry { 31 | 32 | private List pivot = Collections.emptyList(); 33 | 34 | public SimpleFacetPivotEntry(Field field, String value, long count) { 35 | super(value, count); 36 | this.setField(field); 37 | } 38 | 39 | @Override 40 | public List getPivot() { 41 | return pivot; 42 | } 43 | 44 | public void setPivot(List pivot) { 45 | 46 | Assert.notNull(pivot, "Pivot must not be null"); 47 | this.pivot = pivot; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return "SimpleFacetPivotEntry [getField()=" + getField() + ", getValueCount()=" + getValueCount() + ", getValue()=" 53 | + getValue() + ", getPivot()=" + getPivot() + "]"; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/SimpleFacetQueryEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import org.springframework.data.solr.core.query.FilterQuery; 19 | import org.springframework.data.solr.core.query.SimpleQuery; 20 | import org.springframework.data.solr.core.query.SimpleStringCriteria; 21 | 22 | /** 23 | * Trivial implementation of {@link FacetQueryEntry} 24 | * 25 | * @author Christoph Strobl 26 | */ 27 | public class SimpleFacetQueryEntry extends ValueCountEntry implements FacetQueryEntry { 28 | 29 | public SimpleFacetQueryEntry(String value, long count) { 30 | super(value, count); 31 | } 32 | 33 | @Override 34 | public String getKey() { 35 | return getValue(); 36 | } 37 | 38 | @Override 39 | public FilterQuery getQuery() { 40 | return new SimpleQuery(new SimpleStringCriteria(getValue())); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/SimpleGroupEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import org.springframework.data.domain.Page; 19 | 20 | /** 21 | * Represents a group holding the group value and all beans belonging to the group. 22 | * 23 | * @author Francisco Spaeth 24 | * @param 25 | * @since 1.4 26 | */ 27 | public class SimpleGroupEntry implements GroupEntry { 28 | 29 | private String groupValue; 30 | private Page result; 31 | 32 | public SimpleGroupEntry(String groupValue, Page result) { 33 | super(); 34 | this.groupValue = groupValue; 35 | this.result = result; 36 | } 37 | 38 | @Override 39 | public String getGroupValue() { 40 | return groupValue; 41 | } 42 | 43 | @Override 44 | public Page getResult() { 45 | return result; 46 | } 47 | 48 | @Override 49 | public String toString() { 50 | return "SimpleGroupEntry [groupValue=" + groupValue + ", result=" + result + "]"; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/SimpleTermsFieldEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import org.springframework.data.solr.core.query.Field; 19 | 20 | /** 21 | * @author Christoph Strobl 22 | */ 23 | public class SimpleTermsFieldEntry extends FieldValueCountEntry implements TermsFieldEntry { 24 | 25 | public SimpleTermsFieldEntry(String value, long valueCount) { 26 | super(value, valueCount); 27 | } 28 | 29 | public SimpleTermsFieldEntry(Field field, String value, long valueCount) { 30 | super(value, valueCount); 31 | setField(field); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/SpellcheckedPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import org.springframework.data.domain.Page; 19 | 20 | /** 21 | * @author Petar Tahchiev 22 | * @author Christoph Strobl 23 | */ 24 | public interface SpellcheckedPage extends SpellcheckQueryResult, Page { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/StatsPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import java.util.Map; 19 | 20 | import org.springframework.data.domain.Page; 21 | import org.springframework.data.solr.core.query.Field; 22 | import org.springframework.data.solr.core.query.StatsOptions; 23 | 24 | /** 25 | * Representation of a Stats result page, holding one {@link FieldStatsResult} for each field statistic requested on a 26 | * {@link org.springframework.data.solr.core.query.Query} through {@link StatsOptions}. 27 | * 28 | * @author Francisco Spaeth 29 | * @param 30 | * @since 1.4 31 | */ 32 | public interface StatsPage extends Page { 33 | 34 | /** 35 | * Get the stats result done for the given {@link Field}. 36 | * 37 | * @param field 38 | * @return 39 | */ 40 | FieldStatsResult getFieldStatsResult(Field field); 41 | 42 | /** 43 | * Get the stats result done for the field with the given fieldName. 44 | * 45 | * @param fieldName 46 | * @return 47 | */ 48 | FieldStatsResult getFieldStatsResult(String fieldName); 49 | 50 | /** 51 | * Get all field stats results for this page. 52 | * 53 | * @return 54 | */ 55 | Map getFieldStatsResults(); 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/StringPageKey.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | /** 19 | * String implementation of {@link PageKey} 20 | * 21 | * @author Christoph Strobl 22 | */ 23 | public class StringPageKey implements PageKey { 24 | 25 | private final String key; 26 | 27 | public StringPageKey(String key) { 28 | super(); 29 | this.key = key; 30 | } 31 | 32 | @Override 33 | public String getKey() { 34 | return key; 35 | } 36 | 37 | @Override 38 | public int hashCode() { 39 | return key == null ? 0 : key.hashCode(); 40 | } 41 | 42 | @Override 43 | public boolean equals(Object obj) { 44 | if (this == obj) { 45 | return true; 46 | } 47 | if (obj == null) { 48 | return false; 49 | } 50 | if (getClass() != obj.getClass()) { 51 | return false; 52 | } 53 | StringPageKey other = (StringPageKey) obj; 54 | if (key == null) { 55 | if (other.key != null) { 56 | return false; 57 | } 58 | } else if (!key.equals(other.key)) { 59 | return false; 60 | } 61 | return true; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/TermsEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | /** 19 | * @author Christoph Strobl 20 | * 21 | */ 22 | public interface TermsEntry extends CountEntry { 23 | 24 | /** 25 | * @return 26 | */ 27 | Object getKey(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/TermsFieldEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import org.springframework.data.solr.core.query.Field; 19 | 20 | /** 21 | * @author Christoph Strobl 22 | * 23 | */ 24 | public interface TermsFieldEntry extends TermsEntry { 25 | 26 | @Override 27 | Field getKey(); 28 | 29 | /** 30 | * get the associated Field 31 | * 32 | * @return 33 | */ 34 | Field getField(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/TermsPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | import java.util.List; 19 | 20 | import org.springframework.data.domain.Page; 21 | 22 | /** 23 | * @author Christoph Strobl 24 | */ 25 | public interface TermsPage extends Iterable { 26 | 27 | /** 28 | * Returns the page content as {@link List}. 29 | * 30 | * @return 31 | */ 32 | Iterable getContent(); 33 | 34 | /** 35 | * @param fieldname 36 | * @return 37 | */ 38 | Iterable getTermsForField(String fieldname); 39 | 40 | /** 41 | * Returns whether the {@link Page} has content at all. 42 | * 43 | * @return 44 | */ 45 | boolean hasContent(); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/ValueCountEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query.result; 17 | 18 | /** 19 | * Implementation of {@link CountEntry} 20 | * 21 | * @author Christoph Strobl 22 | * 23 | */ 24 | public class ValueCountEntry implements CountEntry { 25 | 26 | private final long valueCount; 27 | private final String value; 28 | 29 | public ValueCountEntry(String value, long valueCount) { 30 | this.value = value; 31 | this.valueCount = valueCount; 32 | } 33 | 34 | @Override 35 | public long getValueCount() { 36 | return valueCount; 37 | } 38 | 39 | @Override 40 | public String getValue() { 41 | return value; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/query/result/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Query result abstractions for Solr returned {@link org.apache.solr.common.util.NamedList}. 3 | */ 4 | @org.springframework.lang.NonNullApi 5 | @org.springframework.lang.NonNullFields 6 | package org.springframework.data.solr.core.query.result; 7 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/schema/ContentParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.schema; 17 | 18 | import org.apache.solr.common.util.ContentStream; 19 | 20 | /** 21 | * @author Christoph Strobl 22 | * @since 1.3 23 | */ 24 | public interface ContentParser { 25 | 26 | ContentStream parse(Object content); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/schema/MappingJacksonRequestContentParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.schema; 17 | 18 | import org.apache.solr.common.util.ContentStreamBase.StringStream; 19 | 20 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 21 | import com.fasterxml.jackson.databind.JsonNode; 22 | import com.fasterxml.jackson.databind.ObjectMapper; 23 | 24 | /** 25 | * @author Christoph Strobl 26 | * @since 1.3 27 | */ 28 | public class MappingJacksonRequestContentParser implements ContentParser { 29 | 30 | private final ObjectMapper mapper; 31 | 32 | public MappingJacksonRequestContentParser() { 33 | mapper = new ObjectMapper(); 34 | mapper.setSerializationInclusion(Include.NON_NULL); 35 | } 36 | 37 | @Override 38 | public StringStream parse(Object content) { 39 | 40 | JsonNode node = mapper.convertValue(content, JsonNode.class); 41 | return new StringStream(node.toString()); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/schema/SchemaModificationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.schema; 17 | 18 | import org.springframework.dao.NonTransientDataAccessException; 19 | 20 | /** 21 | * {@link NonTransientDataAccessException} raised when schema modification requests fail. 22 | * 23 | * @author Christoph Strobl 24 | * @since 2.1 25 | */ 26 | public class SchemaModificationException extends NonTransientDataAccessException { 27 | 28 | /** 29 | * Creates new {@link SchemaModificationException}. 30 | * 31 | * @param msg must not be {@literal null}. 32 | */ 33 | public SchemaModificationException(String msg) { 34 | super(msg); 35 | } 36 | 37 | /** 38 | * Creates new {@link SchemaModificationException}. 39 | * 40 | * @param msg must not be {@literal null}. 41 | * @param cause can be {@literal null}. 42 | */ 43 | public SchemaModificationException(String msg, Throwable cause) { 44 | super(msg, cause); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/schema/SchemaOperations.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.schema; 17 | 18 | import org.springframework.data.solr.core.schema.SchemaDefinition.SchemaField; 19 | 20 | /** 21 | * Operations interface for executing modification on a managed schema. 22 | * 23 | * @author Christoph Strobl 24 | * @since 2.1 25 | */ 26 | public interface SchemaOperations { 27 | 28 | /** 29 | * Get the current schema name. 30 | * 31 | * @return 32 | */ 33 | String getSchemaName(); 34 | 35 | /** 36 | * Get the current schema version. 37 | * 38 | * @return 39 | */ 40 | Double getSchemaVersion(); 41 | 42 | /** 43 | * Read back the {@link SchemaDefinition} from server. 44 | * 45 | * @return 46 | */ 47 | SchemaDefinition readSchema(); 48 | 49 | /** 50 | * Add given {@link SchemaField}. 51 | * 52 | * @param field must not be {@literal null}. 53 | * @throws SchemaModificationException 54 | */ 55 | void addField(SchemaField field); 56 | 57 | /** 58 | * Remove the field with given name. 59 | * 60 | * @param name must not be {@literal null}. 61 | */ 62 | void removeField(String name); 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/core/schema/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Everything Apache Solr schema specific. 3 | */ 4 | @org.springframework.lang.NonNullApi 5 | @org.springframework.lang.NonNullFields 6 | package org.springframework.data.solr.core.schema; 7 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Root stuff used through out Spring Data for Apache Solr. 3 | */ 4 | @org.springframework.lang.NonNullApi 5 | @org.springframework.lang.NonNullFields 6 | package org.springframework.data.solr; 7 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/Boost.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Increase document score by boosting search criteria hit 26 | * 27 | * @author Christoph Strobl 28 | * @author Francisco Spaeth 29 | */ 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Target({ ElementType.PARAMETER }) 32 | @Documented 33 | public @interface Boost { 34 | 35 | /** 36 | * @return Boost Term, or Field by value. Default is {@code Float.NaN}. 37 | */ 38 | float value() default Float.NaN; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/Pivot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository; 17 | 18 | /** 19 | * @author Francisco Spaeth 20 | * @since 1.2 21 | */ 22 | public @interface Pivot { 23 | 24 | /** 25 | * {@code facet.pivot} definition of a pivot field. 26 | * 27 | * @return 28 | */ 29 | String[] value() default {}; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/Score.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | import org.springframework.data.annotation.ReadOnlyProperty; 25 | 26 | /** 27 | * Defines the annotated field to store the score of a document within search result. 28 | * 29 | * @author Christoph Strobl 30 | * @author Francisco Spaeth 31 | * @since 1.4 32 | * @deprecated since 4.0. Use {@link org.springframework.data.solr.core.mapping.Score} instead. 33 | */ 34 | @ReadOnlyProperty 35 | @Documented 36 | @Retention(RetentionPolicy.RUNTIME) 37 | @Target(ElementType.FIELD) 38 | @Deprecated 39 | public @interface Score { 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/SelectiveStats.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository; 17 | 18 | /** 19 | * Definition of field selective statistical that shall be executed within the request. 20 | * 21 | * @author Francisco Spaeth 22 | * @since 1.4 23 | */ 24 | public @interface SelectiveStats { 25 | 26 | /** 27 | * @return field name to which the selective stats are associated to 28 | */ 29 | String field(); 30 | 31 | /** 32 | * @return fields to be facet within this stats field request 33 | */ 34 | String[] facets(); 35 | 36 | /** 37 | * @return if distinct elements for this field shall be calculated 38 | */ 39 | boolean distinct() default false; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/SolrCrudRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository; 17 | 18 | import java.io.Serializable; 19 | import java.time.Duration; 20 | 21 | import org.springframework.data.repository.PagingAndSortingRepository; 22 | 23 | /** 24 | * @param 25 | * @param 26 | * @author Christoph Strobl 27 | * @author Mayank Kumar 28 | */ 29 | public interface SolrCrudRepository 30 | extends SolrRepository, PagingAndSortingRepository { 31 | 32 | /** 33 | * Saves a given entity and commits withing given {@link Duration}. 34 | * 35 | * @param entity must not be {@literal null}. 36 | * @return the saved entity will never be {@literal null}. 37 | * @since 4.0 38 | */ 39 | S save(S entity, Duration commitWithin); 40 | 41 | /** 42 | * Saves all given entities and commits withing given {@link Duration}. 43 | * 44 | * @param entities must not be {@literal null}. 45 | * @return the saved entity will never be {@literal null}. 46 | * @since 4.0 47 | */ 48 | Iterable saveAll(Iterable entities, Duration commitWithin); 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/SolrRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository; 17 | 18 | import java.io.Serializable; 19 | 20 | import org.springframework.data.repository.NoRepositoryBean; 21 | import org.springframework.data.repository.Repository; 22 | 23 | /** 24 | * @param 25 | * @param 26 | * @author Christoph Strobl 27 | */ 28 | @NoRepositoryBean 29 | public interface SolrRepository extends Repository { 30 | 31 | /** 32 | * Returns the number of entities available. 33 | * 34 | * @return the total number of entities 35 | */ 36 | long count(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/Stats.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Statistics definition to be performed within a {@link Query}. 26 | * 27 | * @author Francisco Spaeth 28 | * @since 1.4 29 | */ 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Target(ElementType.METHOD) 32 | @Documented 33 | public @interface Stats { 34 | 35 | /** 36 | * @return fields that shall have its statistics returned. 37 | */ 38 | String[] value() default {}; 39 | 40 | /** 41 | * @return faceting that shall be returned within statistics result. 42 | */ 43 | String[] facets() default {}; 44 | 45 | /** 46 | * @return if distinct elements shall be calculated 47 | */ 48 | boolean distinct() default false; 49 | 50 | /** 51 | * @return field selective stats parameters. 52 | */ 53 | SelectiveStats[] selective() default {}; 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/cdi/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Cdi extension. 3 | */ 4 | @org.springframework.lang.NonNullApi 5 | @org.springframework.lang.NonNullFields 6 | package org.springframework.data.solr.repository.cdi; 7 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/config/SolrRepositoriesRegistrar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository.config; 17 | 18 | import java.lang.annotation.Annotation; 19 | 20 | import org.springframework.context.annotation.ImportBeanDefinitionRegistrar; 21 | import org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport; 22 | import org.springframework.data.repository.config.RepositoryConfigurationExtension; 23 | 24 | /** 25 | * {@link ImportBeanDefinitionRegistrar} implementation to trigger configuration of the {@link EnableSolrRepositories} 26 | * annotation. 27 | * 28 | * @author Oliver Gierke 29 | */ 30 | class SolrRepositoriesRegistrar extends RepositoryBeanDefinitionRegistrarSupport { 31 | 32 | /* 33 | * (non-Javadoc) 34 | * @see org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport#getAnnotation() 35 | */ 36 | @Override 37 | protected Class getAnnotation() { 38 | return EnableSolrRepositories.class; 39 | } 40 | 41 | /* 42 | * (non-Javadoc) 43 | * @see org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport#getExtension() 44 | */ 45 | @Override 46 | protected RepositoryConfigurationExtension getExtension() { 47 | return new SolrRepositoryConfigExtension(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Repository configuration and extension support. 3 | */ 4 | @org.springframework.lang.NonNullApi 5 | @org.springframework.lang.NonNullFields 6 | package org.springframework.data.solr.repository.config; 7 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Solr specific repository implementation. 3 | * {@link org.springframework.data.solr.repository.support.SimpleSolrRepository} provides Solr specific implementation of {@link org.springframework.data.repository.CrudRepository}. 4 | */ 5 | @org.springframework.lang.NonNullApi 6 | @org.springframework.lang.NonNullFields 7 | package org.springframework.data.solr.repository; 8 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/query/BindableSolrParameter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository.query; 17 | 18 | /** 19 | * Used to provide additional information on parameters used in query definition. This allows to access per parameter 20 | * metadata such as Boost values. 21 | * 22 | * @author Christoph Strobl 23 | */ 24 | public class BindableSolrParameter { 25 | 26 | private final int index; 27 | private final Object value; 28 | private float boost; 29 | 30 | public BindableSolrParameter(int index, Object value) { 31 | super(); 32 | this.index = index; 33 | this.value = value; 34 | } 35 | 36 | public float getBoost() { 37 | return boost; 38 | } 39 | 40 | public void setBoost(float boost) { 41 | this.boost = boost; 42 | } 43 | 44 | public int getIndex() { 45 | return index; 46 | } 47 | 48 | public Object getValue() { 49 | return value; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/query/SolrEntityInformation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository.query; 17 | 18 | import org.springframework.data.repository.core.EntityInformation; 19 | 20 | /** 21 | * @param 22 | * @param 23 | * @author Christoph Strobl 24 | */ 25 | public interface SolrEntityInformation extends EntityInformation { 26 | 27 | /** 28 | * Get the name of the id attribute. 29 | * 30 | * @return 31 | */ 32 | String getIdAttribute(); 33 | 34 | /** 35 | * Get the name of the solr collection the entity resides in. 36 | * 37 | * @return 38 | */ 39 | String getCollectionName(); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/query/SolrEntityInformationCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository.query; 17 | 18 | /** 19 | * @author Christoph Strobl 20 | */ 21 | public interface SolrEntityInformationCreator { 22 | 23 | SolrEntityInformation getEntityInformation(Class domainClass); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/query/SolrParameter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository.query; 17 | 18 | import org.springframework.core.MethodParameter; 19 | import org.springframework.data.repository.query.Parameter; 20 | import org.springframework.data.solr.repository.Boost; 21 | import org.springframework.lang.Nullable; 22 | 23 | /** 24 | * Solr specific {@link Parameter} implementation 25 | * 26 | * @author Christoph Strobl 27 | */ 28 | class SolrParameter extends Parameter { 29 | 30 | private final MethodParameter parameter; 31 | 32 | protected SolrParameter(MethodParameter parameter) { 33 | super(parameter); 34 | this.parameter = parameter; 35 | } 36 | 37 | @Nullable 38 | private Boost getBoostAnnotation() { 39 | return parameter.getParameterAnnotation(Boost.class); 40 | } 41 | 42 | private boolean hasBoostAnnotation() { 43 | return getBoostAnnotation() != null; 44 | } 45 | 46 | /** 47 | * if method parameter has {@link Boost} use it 48 | * 49 | * @return Float.NaN by default 50 | */ 51 | public float getBoost() { 52 | if (hasBoostAnnotation()) { 53 | return getBoostAnnotation().value(); 54 | } 55 | return Float.NaN; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/query/SolrParameterAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository.query; 17 | 18 | import org.springframework.data.repository.query.ParameterAccessor; 19 | 20 | /** 21 | * @author Christoph Strobl 22 | */ 23 | public interface SolrParameterAccessor extends ParameterAccessor { 24 | 25 | /** 26 | * Get boost value for element at index if defined 27 | * @param index bindable parameter index 28 | * @return {@code Float.NaN} as default 29 | */ 30 | float getBoost(int index); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/query/SolrParameters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository.query; 17 | 18 | import java.lang.reflect.Method; 19 | import java.util.List; 20 | 21 | import org.springframework.core.MethodParameter; 22 | import org.springframework.data.repository.query.Parameters; 23 | 24 | /** 25 | * @author Christoph Strobl 26 | */ 27 | public class SolrParameters extends Parameters { 28 | 29 | public SolrParameters(Method method) { 30 | super(method); 31 | } 32 | 33 | public SolrParameters(List parameters) { 34 | super(parameters); 35 | } 36 | 37 | @Override 38 | protected SolrParameter createParameter(MethodParameter parameter) { 39 | return new SolrParameter(parameter); 40 | } 41 | 42 | @Override 43 | protected SolrParameters createFrom(List parameters) { 44 | return new SolrParameters(parameters); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/query/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Apache Solr specific repository query methods and executions. 3 | */ 4 | @org.springframework.lang.NonNullApi 5 | @org.springframework.lang.NonNullFields 6 | package org.springframework.data.solr.repository.query; 7 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/support/MappingSolrEntityInformation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository.support; 17 | 18 | import org.springframework.data.repository.core.support.AbstractEntityInformation; 19 | import org.springframework.data.repository.core.support.PersistentEntityInformation; 20 | import org.springframework.data.solr.core.mapping.SolrPersistentEntity; 21 | import org.springframework.data.solr.repository.query.SolrEntityInformation; 22 | 23 | /** 24 | * Solr specific implementation of {@link AbstractEntityInformation} 25 | * 26 | * @param 27 | * @param 28 | * @author Christoph Strobl 29 | * @author Oliver Gierke 30 | * @author Mark Paluch 31 | */ 32 | public class MappingSolrEntityInformation extends PersistentEntityInformation 33 | implements SolrEntityInformation { 34 | 35 | private final SolrPersistentEntity entityMetadata; 36 | 37 | public MappingSolrEntityInformation(SolrPersistentEntity entity) { 38 | super(entity); 39 | this.entityMetadata = entity; 40 | } 41 | 42 | @Override 43 | public String getIdAttribute() { 44 | return entityMetadata.getRequiredIdProperty().getFieldName(); 45 | } 46 | 47 | public String getCollectionName() { 48 | return entityMetadata.getCollectionName(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/repository/support/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Repository support classes for bootstrapping application context. 3 | */ 4 | @org.springframework.lang.NonNullApi 5 | @org.springframework.lang.NonNullFields 6 | package org.springframework.data.solr.repository.support; 7 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/server/SolrClientFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.server; 17 | 18 | import org.apache.solr.client.solrj.SolrClient; 19 | 20 | /** 21 | * {@link SolrClientFactory} replaces SolrServerFactory from version 1.x and provides access to the solrj 22 | * {@link SolrClient}. 23 | * 24 | * @author Christoph Strobl 25 | * @since 2.0 26 | */ 27 | @FunctionalInterface 28 | public interface SolrClientFactory { 29 | 30 | /** 31 | * Get base {@link SolrClient} instance 32 | * 33 | * @return a reusable SolrClient instance 34 | */ 35 | SolrClient getSolrClient(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/server/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Config support for {@link org.apache.solr.client.solrj.SolrClient}. 3 | */ 4 | @org.springframework.lang.NonNullApi 5 | @org.springframework.lang.NonNullFields 6 | package org.springframework.data.solr.server.config; 7 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/server/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SolrClient configuration and spring integration. 3 | */ 4 | package org.springframework.data.solr.server; 5 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/server/support/EmbeddedSolrServerFactoryBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.server.support; 17 | 18 | import org.apache.solr.client.solrj.SolrClient; 19 | import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer; 20 | import org.springframework.beans.factory.DisposableBean; 21 | import org.springframework.beans.factory.FactoryBean; 22 | import org.springframework.beans.factory.InitializingBean; 23 | 24 | /** 25 | * Implementation of {@link FactoryBean} for registration of an EmbeddedSolrServer as a Spring bean. Implements 26 | * {@link DisposableBean} to shut down the core container when the enclosing Spring container is destroyed. 27 | * 28 | * @author Christoph Strobl 29 | */ 30 | public class EmbeddedSolrServerFactoryBean extends EmbeddedSolrServerFactory 31 | implements FactoryBean, InitializingBean, DisposableBean { 32 | 33 | @Override 34 | public void afterPropertiesSet() throws Exception { 35 | initCoreContainer(); 36 | } 37 | 38 | @Override 39 | public EmbeddedSolrServer getObject() throws Exception { 40 | return getSolrClient(); 41 | } 42 | 43 | @Override 44 | public Class getObjectType() { 45 | return EmbeddedSolrServer.class; 46 | } 47 | 48 | @Override 49 | public boolean isSingleton() { 50 | return true; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/solr/server/support/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Everything {@link org.apache.solr.client.solrj.SolrClient} and 3 | * {@link org.apache.solr.client.solrj.embedded.EmbeddedSolrServer} related. 4 | */ 5 | @org.springframework.lang.NonNullApi 6 | @org.springframework.lang.NonNullFields 7 | package org.springframework.data.solr.server.support; 8 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | org.springframework.data.solr.repository.cdi.SolrRepositoryExtension -------------------------------------------------------------------------------- /src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.data.repository.core.support.RepositoryFactorySupport=org.springframework.data.solr.repository.support.SolrRepositoryFactory 2 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/spring.handlers: -------------------------------------------------------------------------------- 1 | http\://www.springframework.org/schema/data/solr=org.springframework.data.solr.config.SolrNamespaceHandler 2 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/spring.schemas: -------------------------------------------------------------------------------- 1 | http\://www.springframework.org/schema/data/solr/spring-solr-1.0.xsd=org/springframework/data/solr/config/spring-solr-1.0.xsd 2 | http\://www.springframework.org/schema/data/solr/spring-solr-2.0.xsd=org/springframework/data/solr/config/spring-solr-2.0.xsd 3 | http\://www.springframework.org/schema/data/solr/spring-solr-3.0.xsd=org/springframework/data/solr/config/spring-solr-3.0.xsd 4 | http\://www.springframework.org/schema/data/solr/spring-solr-4.0.xsd=org/springframework/data/solr/config/spring-solr-4.0.xsd 5 | http\://www.springframework.org/schema/data/solr/spring-solr.xsd=org/springframework/data/solr/config/spring-solr-4.0.xsd 6 | https\://www.springframework.org/schema/data/solr/spring-solr-1.0.xsd=org/springframework/data/solr/config/spring-solr-1.0.xsd 7 | https\://www.springframework.org/schema/data/solr/spring-solr-2.0.xsd=org/springframework/data/solr/config/spring-solr-2.0.xsd 8 | https\://www.springframework.org/schema/data/solr/spring-solr-3.0.xsd=org/springframework/data/solr/config/spring-solr-3.0.xsd 9 | https\://www.springframework.org/schema/data/solr/spring-solr-4.0.xsd=org/springframework/data/solr/config/spring-solr-4.0.xsd 10 | https\://www.springframework.org/schema/data/solr/spring-solr.xsd=org/springframework/data/solr/config/spring-solr-4.0.xsd 11 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/spring.tooling: -------------------------------------------------------------------------------- 1 | # Tooling related information for the Solr namespace 2 | http\://www.springframework.org/schema/data/solr@name=Solr Namespace 3 | http\://www.springframework.org/schema/data/solr@prefix=solr 4 | http\://www.springframework.org/schema/data/solr@icon=org/springframework/jdbc/config/spring-jdbc.gif 5 | -------------------------------------------------------------------------------- /src/main/resources/notice.txt: -------------------------------------------------------------------------------- 1 | Spring Data for Apache Solr 4.3 GA (2020.0.0) 2 | Copyright (c) [2013-2019] Pivotal Software, Inc. 3 | 4 | This product is licensed to you under the Apache License, Version 2.0 (the "License"). 5 | You may not use this product except in compliance with the License. 6 | 7 | This product may include a number of subcomponents with 8 | separate copyright notices and license terms. Your use of the source 9 | code for the these subcomponents is subject to the terms and 10 | conditions of the subcomponent's license, as noted in the LICENSE file. 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/solr/core/SimpleJavaObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core; 17 | 18 | import org.apache.solr.client.solrj.beans.Field; 19 | 20 | /** 21 | * @author Christoph Strobl 22 | */ 23 | public class SimpleJavaObject { 24 | 25 | @Field 26 | private String id; 27 | 28 | @Field 29 | private Long value; 30 | 31 | public SimpleJavaObject() { 32 | } 33 | 34 | public SimpleJavaObject(String id, Long value) { 35 | super(); 36 | this.id = id; 37 | this.value = value; 38 | } 39 | 40 | public String getId() { 41 | return id; 42 | } 43 | 44 | public void setId(String id) { 45 | this.id = id; 46 | } 47 | 48 | public Long getValue() { 49 | return value; 50 | } 51 | 52 | public void setValue(Long value) { 53 | this.value = value; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/solr/core/query/PartialUpdateTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import static org.assertj.core.api.Assertions.*; 19 | 20 | import org.junit.Test; 21 | 22 | /** 23 | * @author Christoph Strobl 24 | */ 25 | public class PartialUpdateTests { 26 | 27 | @Test 28 | public void testAddValueToField() { 29 | PartialUpdate update = new PartialUpdate("id", "123"); 30 | update.addValueToField("name", "value-to-add"); 31 | 32 | assertThat(update.getUpdates().size()).isEqualTo(1); 33 | assertThat(update.getUpdates().get(0).getAction()).isEqualTo(UpdateAction.ADD); 34 | } 35 | 36 | @Test 37 | public void testSetValueForField() { 38 | PartialUpdate update = new PartialUpdate("id", "123"); 39 | update.setValueOfField("name", "value-to-set"); 40 | 41 | assertThat(update.getUpdates().size()).isEqualTo(1); 42 | assertThat(update.getUpdates().get(0).getAction()).isEqualTo(UpdateAction.SET); 43 | } 44 | 45 | @Test 46 | public void testIncreaseValueForField() { 47 | PartialUpdate update = new PartialUpdate("id", "123"); 48 | update.increaseValueOfField("popularity", 2); 49 | 50 | assertThat(update.getUpdates().size()).isEqualTo(1); 51 | assertThat(update.getUpdates().get(0).getAction()).isEqualTo(UpdateAction.INC); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/solr/core/query/SimpleHighlightQueryTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import static org.assertj.core.api.Assertions.*; 19 | 20 | import org.junit.Before; 21 | import org.junit.Test; 22 | 23 | /** 24 | * @author Christoph Strobl 25 | */ 26 | public class SimpleHighlightQueryTests { 27 | 28 | private SimpleHighlightQuery query; 29 | 30 | @Before 31 | public void setUp() { 32 | query = new SimpleHighlightQuery(); 33 | } 34 | 35 | @Test 36 | public void testWithoutHighlightOptions() { 37 | assertThat(query.getHighlightOptions()).isNull(); 38 | assertThat(query.hasHighlightOptions()).isFalse(); 39 | } 40 | 41 | @Test 42 | public void testSetHighlightOptions() { 43 | query.setHighlightOptions(new HighlightOptions()); 44 | assertThat(query.getHighlightOptions()).isNotNull(); 45 | assertThat(query.hasHighlightOptions()).isTrue(); 46 | } 47 | 48 | @Test 49 | public void testSetNullHighlightOptions() { 50 | query.setHighlightOptions(null); 51 | assertThat(query.getHighlightOptions()).isNull(); 52 | assertThat(query.hasHighlightOptions()).isFalse(); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/solr/core/query/SimpleStringCriteriaTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.core.query; 17 | 18 | import static org.assertj.core.api.Assertions.*; 19 | 20 | import org.junit.Test; 21 | 22 | /** 23 | * @author Christoph Strobl 24 | */ 25 | public class SimpleStringCriteriaTests { 26 | 27 | @Test 28 | public void testStringCriteria() { 29 | SimpleStringCriteria criteria = new SimpleStringCriteria("field_1:value_1 AND field_2:value_2"); 30 | assertThat(criteria.getQueryString()).isEqualTo("field_1:value_1 AND field_2:value_2"); 31 | } 32 | 33 | @Test 34 | public void testStringCriteriaWithMoreFragmentsCreatesCrotch() { 35 | Criteria criteria = new SimpleStringCriteria("field_1:value_1 AND field_2:value_2"); 36 | criteria = criteria.and("field_3").is("value_3"); 37 | assertThat(criteria).isInstanceOf(Crotch.class); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/solr/repository/ExampleSolrBeanRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository; 17 | 18 | import org.springframework.data.solr.ExampleSolrBean; 19 | import org.springframework.data.solr.core.SolrOperations; 20 | import org.springframework.data.solr.repository.support.SimpleSolrRepository; 21 | 22 | /** 23 | * @author Christoph Strobl 24 | */ 25 | public class ExampleSolrBeanRepository extends SimpleSolrRepository { 26 | 27 | public ExampleSolrBeanRepository(SolrOperations solrOperations, Class entityClass) { 28 | super(solrOperations, entityClass); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/solr/repository/cdi/CdiProductRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository.cdi; 17 | 18 | import java.util.Optional; 19 | 20 | import org.springframework.data.solr.repository.ProductBean; 21 | import org.springframework.data.solr.repository.SolrCrudRepository; 22 | 23 | /** 24 | * @author Christoph Strobl 25 | */ 26 | public interface CdiProductRepository extends SolrCrudRepository { 27 | 28 | Optional findById(String id); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/solr/repository/cdi/CdiRepositoryClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository.cdi; 17 | 18 | import javax.inject.Inject; 19 | 20 | /** 21 | * @author Christoph Strobl 22 | * @author Mark Paluch 23 | */ 24 | class CdiRepositoryClient { 25 | 26 | private CdiProductRepository repository; 27 | 28 | private SamplePersonRepository samplePersonRepository; 29 | 30 | public CdiProductRepository getRepository() { 31 | return repository; 32 | } 33 | 34 | @Inject 35 | public void setRepository(CdiProductRepository repository) { 36 | this.repository = repository; 37 | } 38 | 39 | public SamplePersonRepository getSamplePersonRepository() { 40 | return samplePersonRepository; 41 | } 42 | 43 | @Inject 44 | public void setSamplePersonRepository(SamplePersonRepository samplePersonRepository) { 45 | this.samplePersonRepository = samplePersonRepository; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/solr/repository/cdi/SamplePersonFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository.cdi; 17 | 18 | /** 19 | * @author Mark Paluch 20 | */ 21 | interface SamplePersonFragment { 22 | 23 | int returnOne(); 24 | } 25 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/solr/repository/cdi/SamplePersonFragmentImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository.cdi; 17 | 18 | /** 19 | * @author Mark Paluch 20 | */ 21 | class SamplePersonFragmentImpl implements SamplePersonFragment { 22 | 23 | @Override 24 | public int returnOne() { 25 | return 1; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/solr/repository/cdi/SamplePersonRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository.cdi; 17 | 18 | import org.springframework.data.repository.Repository; 19 | import org.springframework.data.solr.repository.config.Person; 20 | 21 | /** 22 | * @author Mark Paluch 23 | */ 24 | public interface SamplePersonRepository extends Repository, SamplePersonFragment { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/solr/repository/config/Person.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository.config; 17 | 18 | import org.springframework.data.annotation.Id; 19 | 20 | public class Person { 21 | 22 | @Id 23 | Long id; 24 | } 25 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/solr/repository/config/PersonRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository.config; 17 | 18 | import org.springframework.data.repository.Repository; 19 | 20 | public interface PersonRepository extends Repository { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/solr/repository/config/SolrRepositoryConfigExtensionUnitTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.repository.config; 17 | 18 | import static org.assertj.core.api.Assertions.*; 19 | 20 | import org.junit.Test; 21 | import org.springframework.data.solr.core.mapping.SolrDocument; 22 | import org.springframework.data.solr.repository.SolrCrudRepository; 23 | import org.springframework.data.solr.repository.SolrRepository; 24 | 25 | /** 26 | * @author Christoph Strobl 27 | */ 28 | public class SolrRepositoryConfigExtensionUnitTests { 29 | 30 | private SolrRepositoryConfigExtension extension = new SolrRepositoryConfigExtension(); 31 | 32 | @Test // DATASOLR-184 33 | public void shouldReturnSolrDocumentAsIdentifyingAnnotation() { 34 | 35 | assertThat(extension.getIdentifyingAnnotations()).hasSize(1); 36 | assertThat(extension.getIdentifyingAnnotations()).contains(SolrDocument.class); 37 | } 38 | 39 | @Test // DATASOLR-184 40 | public void shoudReturnStoreSpecificRepositoryInterfacesAsIdentifyingTypes() { 41 | 42 | assertThat(extension.getIdentifyingTypes()).hasSize(2); 43 | assertThat(extension.getIdentifyingTypes()).contains(SolrRepository.class, SolrCrudRepository.class); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/solr/test/util/GenericMockFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 - 2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.solr.test.util; 17 | 18 | import org.mockito.Mockito; 19 | import org.springframework.beans.factory.FactoryBean; 20 | 21 | /** 22 | * @author Christoph Strobl 23 | */ 24 | public class GenericMockFactory implements FactoryBean { 25 | 26 | private Class type; 27 | 28 | @Override 29 | public T getObject() throws Exception { 30 | return Mockito.mock(type); 31 | } 32 | 33 | @Override 34 | public Class getObjectType() { 35 | return type; 36 | } 37 | 38 | @Override 39 | public boolean isSingleton() { 40 | return true; 41 | } 42 | 43 | public void setType(Class type) { 44 | this.type = type; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/test/resources/META-INF/solr-named-queries.properties: -------------------------------------------------------------------------------- 1 | ProductBean.findByNamedQuery=popularity:?0 2 | ProductBean.findByNamedQueryUsingAvailable=inStock:?0 -------------------------------------------------------------------------------- /src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | %d %5p %40.40c:%4L - %m%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/elevate.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 26 | 27 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/email_url_types.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/lang/contractions_ca.txt: -------------------------------------------------------------------------------- 1 | # Set of Catalan contractions for ElisionFilter 2 | # TODO: load this as a resource from the analyzer and sync it in build.xml 3 | d 4 | l 5 | m 6 | n 7 | s 8 | t 9 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/lang/contractions_fr.txt: -------------------------------------------------------------------------------- 1 | # Set of French contractions for ElisionFilter 2 | # TODO: load this as a resource from the analyzer and sync it in build.xml 3 | l 4 | m 5 | t 6 | qu 7 | n 8 | s 9 | j 10 | d 11 | c 12 | jusqu 13 | quoiqu 14 | lorsqu 15 | puisqu 16 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/lang/contractions_ga.txt: -------------------------------------------------------------------------------- 1 | # Set of Irish contractions for ElisionFilter 2 | # TODO: load this as a resource from the analyzer and sync it in build.xml 3 | d 4 | m 5 | b 6 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/lang/contractions_it.txt: -------------------------------------------------------------------------------- 1 | # Set of Italian contractions for ElisionFilter 2 | # TODO: load this as a resource from the analyzer and sync it in build.xml 3 | c 4 | l 5 | all 6 | dall 7 | dell 8 | nell 9 | sull 10 | coll 11 | pell 12 | gl 13 | agl 14 | dagl 15 | degl 16 | negl 17 | sugl 18 | un 19 | m 20 | t 21 | s 22 | v 23 | d 24 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/lang/hyphenations_ga.txt: -------------------------------------------------------------------------------- 1 | # Set of Irish hyphenations for StopFilter 2 | # TODO: load this as a resource from the analyzer and sync it in build.xml 3 | h 4 | n 5 | t 6 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/lang/stemdict_nl.txt: -------------------------------------------------------------------------------- 1 | # Set of overrides for the dutch stemmer 2 | # TODO: load this as a resource from the analyzer and sync it in build.xml 3 | fiets fiets 4 | bromfiets bromfiets 5 | ei eier 6 | kind kinder 7 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/lang/stopwords_ar.txt: -------------------------------------------------------------------------------- 1 | # This file was created by Jacques Savoy and is distributed under the BSD license. 2 | # See http://members.unine.ch/jacques.savoy/clef/index.html. 3 | # Also see https://www.opensource.org/licenses/bsd-license.html 4 | # Cleaned on October 11, 2009 (not normalized, so use before normalization) 5 | # This means that when modifying this list, you might need to add some 6 | # redundant entries, for example containing forms with both أ and ا 7 | من 8 | ومن 9 | منها 10 | منه 11 | في 12 | وفي 13 | فيها 14 | فيه 15 | و 16 | ف 17 | ثم 18 | او 19 | أو 20 | ب 21 | بها 22 | به 23 | ا 24 | أ 25 | اى 26 | اي 27 | أي 28 | أى 29 | لا 30 | ولا 31 | الا 32 | ألا 33 | إلا 34 | لكن 35 | ما 36 | وما 37 | كما 38 | فما 39 | عن 40 | مع 41 | اذا 42 | إذا 43 | ان 44 | أن 45 | إن 46 | انها 47 | أنها 48 | إنها 49 | انه 50 | أنه 51 | إنه 52 | بان 53 | بأن 54 | فان 55 | فأن 56 | وان 57 | وأن 58 | وإن 59 | التى 60 | التي 61 | الذى 62 | الذي 63 | الذين 64 | الى 65 | الي 66 | إلى 67 | إلي 68 | على 69 | عليها 70 | عليه 71 | اما 72 | أما 73 | إما 74 | ايضا 75 | أيضا 76 | كل 77 | وكل 78 | لم 79 | ولم 80 | لن 81 | ولن 82 | هى 83 | هي 84 | هو 85 | وهى 86 | وهي 87 | وهو 88 | فهى 89 | فهي 90 | فهو 91 | انت 92 | أنت 93 | لك 94 | لها 95 | له 96 | هذه 97 | هذا 98 | تلك 99 | ذلك 100 | هناك 101 | كانت 102 | كان 103 | يكون 104 | تكون 105 | وكانت 106 | وكان 107 | غير 108 | بعض 109 | قد 110 | نحو 111 | بين 112 | بينما 113 | منذ 114 | ضمن 115 | حيث 116 | الان 117 | الآن 118 | خلال 119 | بعد 120 | قبل 121 | حتى 122 | عند 123 | عندما 124 | لدى 125 | جميع 126 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/lang/stopwords_cz.txt: -------------------------------------------------------------------------------- 1 | a 2 | s 3 | k 4 | o 5 | i 6 | u 7 | v 8 | z 9 | dnes 10 | cz 11 | tímto 12 | budeš 13 | budem 14 | byli 15 | jseš 16 | můj 17 | svým 18 | ta 19 | tomto 20 | tohle 21 | tuto 22 | tyto 23 | jej 24 | zda 25 | proč 26 | máte 27 | tato 28 | kam 29 | tohoto 30 | kdo 31 | kteří 32 | mi 33 | nám 34 | tom 35 | tomuto 36 | mít 37 | nic 38 | proto 39 | kterou 40 | byla 41 | toho 42 | protože 43 | asi 44 | ho 45 | naši 46 | napište 47 | re 48 | což 49 | tím 50 | takže 51 | svých 52 | její 53 | svými 54 | jste 55 | aj 56 | tu 57 | tedy 58 | teto 59 | bylo 60 | kde 61 | ke 62 | pravé 63 | ji 64 | nad 65 | nejsou 66 | či 67 | pod 68 | téma 69 | mezi 70 | přes 71 | ty 72 | pak 73 | vám 74 | ani 75 | když 76 | však 77 | neg 78 | jsem 79 | tento 80 | článku 81 | články 82 | aby 83 | jsme 84 | před 85 | pta 86 | jejich 87 | byl 88 | ještě 89 | až 90 | bez 91 | také 92 | pouze 93 | první 94 | vaše 95 | která 96 | nás 97 | nový 98 | tipy 99 | pokud 100 | může 101 | strana 102 | jeho 103 | své 104 | jiné 105 | zprávy 106 | nové 107 | není 108 | vás 109 | jen 110 | podle 111 | zde 112 | už 113 | být 114 | více 115 | bude 116 | již 117 | než 118 | který 119 | by 120 | které 121 | co 122 | nebo 123 | ten 124 | tak 125 | má 126 | při 127 | od 128 | po 129 | jsou 130 | jak 131 | další 132 | ale 133 | si 134 | se 135 | ve 136 | to 137 | jako 138 | za 139 | zpět 140 | ze 141 | do 142 | pro 143 | je 144 | na 145 | atd 146 | atp 147 | jakmile 148 | přičemž 149 | já 150 | on 151 | ona 152 | ono 153 | oni 154 | ony 155 | my 156 | vy 157 | jí 158 | ji 159 | mě 160 | mne 161 | jemu 162 | tomu 163 | těm 164 | těmu 165 | němu 166 | němuž 167 | jehož 168 | jíž 169 | jelikož 170 | jež 171 | jakož 172 | načež 173 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/lang/stopwords_el.txt: -------------------------------------------------------------------------------- 1 | # Lucene Greek Stopwords list 2 | # Note: by default this file is used after GreekLowerCaseFilter, 3 | # so when modifying this file use 'σ' instead of 'ς' 4 | ο 5 | η 6 | το 7 | οι 8 | τα 9 | του 10 | τησ 11 | των 12 | τον 13 | την 14 | και 15 | κι 16 | κ 17 | ειμαι 18 | εισαι 19 | ειναι 20 | ειμαστε 21 | ειστε 22 | στο 23 | στον 24 | στη 25 | στην 26 | μα 27 | αλλα 28 | απο 29 | για 30 | προσ 31 | με 32 | σε 33 | ωσ 34 | παρα 35 | αντι 36 | κατα 37 | μετα 38 | θα 39 | να 40 | δε 41 | δεν 42 | μη 43 | μην 44 | επι 45 | ενω 46 | εαν 47 | αν 48 | τοτε 49 | που 50 | πωσ 51 | ποιοσ 52 | ποια 53 | ποιο 54 | ποιοι 55 | ποιεσ 56 | ποιων 57 | ποιουσ 58 | αυτοσ 59 | αυτη 60 | αυτο 61 | αυτοι 62 | αυτων 63 | αυτουσ 64 | αυτεσ 65 | αυτα 66 | εκεινοσ 67 | εκεινη 68 | εκεινο 69 | εκεινοι 70 | εκεινεσ 71 | εκεινα 72 | εκεινων 73 | εκεινουσ 74 | οπωσ 75 | ομωσ 76 | ισωσ 77 | οσο 78 | οτι 79 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/lang/stopwords_en.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # a couple of test stopwords to test that the words are really being 17 | # configured from this file: 18 | stopworda 19 | stopwordb 20 | 21 | # Standard english stop words taken from Lucene's StopAnalyzer 22 | a 23 | an 24 | and 25 | are 26 | as 27 | at 28 | be 29 | but 30 | by 31 | for 32 | if 33 | in 34 | into 35 | is 36 | it 37 | no 38 | not 39 | of 40 | on 41 | or 42 | such 43 | that 44 | the 45 | their 46 | then 47 | there 48 | these 49 | they 50 | this 51 | to 52 | was 53 | will 54 | with 55 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/lang/stopwords_eu.txt: -------------------------------------------------------------------------------- 1 | # example set of basque stopwords 2 | al 3 | anitz 4 | arabera 5 | asko 6 | baina 7 | bat 8 | batean 9 | batek 10 | bati 11 | batzuei 12 | batzuek 13 | batzuetan 14 | batzuk 15 | bera 16 | beraiek 17 | berau 18 | berauek 19 | bere 20 | berori 21 | beroriek 22 | beste 23 | bezala 24 | da 25 | dago 26 | dira 27 | ditu 28 | du 29 | dute 30 | edo 31 | egin 32 | ere 33 | eta 34 | eurak 35 | ez 36 | gainera 37 | gu 38 | gutxi 39 | guzti 40 | haiei 41 | haiek 42 | haietan 43 | hainbeste 44 | hala 45 | han 46 | handik 47 | hango 48 | hara 49 | hari 50 | hark 51 | hartan 52 | hau 53 | hauei 54 | hauek 55 | hauetan 56 | hemen 57 | hemendik 58 | hemengo 59 | hi 60 | hona 61 | honek 62 | honela 63 | honetan 64 | honi 65 | hor 66 | hori 67 | horiei 68 | horiek 69 | horietan 70 | horko 71 | horra 72 | horrek 73 | horrela 74 | horretan 75 | horri 76 | hortik 77 | hura 78 | izan 79 | ni 80 | noiz 81 | nola 82 | non 83 | nondik 84 | nongo 85 | nor 86 | nora 87 | ze 88 | zein 89 | zen 90 | zenbait 91 | zenbat 92 | zer 93 | zergatik 94 | ziren 95 | zituen 96 | zu 97 | zuek 98 | zuen 99 | zuten 100 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/lang/stopwords_ga.txt: -------------------------------------------------------------------------------- 1 | 2 | a 3 | ach 4 | ag 5 | agus 6 | an 7 | aon 8 | ar 9 | arna 10 | as 11 | b' 12 | ba 13 | beirt 14 | bhúr 15 | caoga 16 | ceathair 17 | ceathrar 18 | chomh 19 | chtó 20 | chuig 21 | chun 22 | cois 23 | céad 24 | cúig 25 | cúigear 26 | d' 27 | daichead 28 | dar 29 | de 30 | deich 31 | deichniúr 32 | den 33 | dhá 34 | do 35 | don 36 | dtí 37 | dá 38 | dár 39 | dó 40 | faoi 41 | faoin 42 | faoina 43 | faoinár 44 | fara 45 | fiche 46 | gach 47 | gan 48 | go 49 | gur 50 | haon 51 | hocht 52 | i 53 | iad 54 | idir 55 | in 56 | ina 57 | ins 58 | inár 59 | is 60 | le 61 | leis 62 | lena 63 | lenár 64 | m' 65 | mar 66 | mo 67 | mé 68 | na 69 | nach 70 | naoi 71 | naonúr 72 | ná 73 | ní 74 | níor 75 | nó 76 | nócha 77 | ocht 78 | ochtar 79 | os 80 | roimh 81 | sa 82 | seacht 83 | seachtar 84 | seachtó 85 | seasca 86 | seisear 87 | siad 88 | sibh 89 | sinn 90 | sna 91 | sé 92 | sí 93 | tar 94 | thar 95 | thú 96 | triúr 97 | trí 98 | trína 99 | trínár 100 | tríocha 101 | tú 102 | um 103 | ár 104 | é 105 | éis 106 | í 107 | ó 108 | ón 109 | óna 110 | ónár 111 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/lang/stopwords_gl.txt: -------------------------------------------------------------------------------- 1 | # galican stopwords 2 | a 3 | aínda 4 | alí 5 | aquel 6 | aquela 7 | aquelas 8 | aqueles 9 | aquilo 10 | aquí 11 | ao 12 | aos 13 | as 14 | así 15 | á 16 | ben 17 | cando 18 | che 19 | co 20 | coa 21 | comigo 22 | con 23 | connosco 24 | contigo 25 | convosco 26 | coas 27 | cos 28 | cun 29 | cuns 30 | cunha 31 | cunhas 32 | da 33 | dalgunha 34 | dalgunhas 35 | dalgún 36 | dalgúns 37 | das 38 | de 39 | del 40 | dela 41 | delas 42 | deles 43 | desde 44 | deste 45 | do 46 | dos 47 | dun 48 | duns 49 | dunha 50 | dunhas 51 | e 52 | el 53 | ela 54 | elas 55 | eles 56 | en 57 | era 58 | eran 59 | esa 60 | esas 61 | ese 62 | eses 63 | esta 64 | estar 65 | estaba 66 | está 67 | están 68 | este 69 | estes 70 | estiven 71 | estou 72 | eu 73 | é 74 | facer 75 | foi 76 | foron 77 | fun 78 | había 79 | hai 80 | iso 81 | isto 82 | la 83 | las 84 | lle 85 | lles 86 | lo 87 | los 88 | mais 89 | me 90 | meu 91 | meus 92 | min 93 | miña 94 | miñas 95 | moi 96 | na 97 | nas 98 | neste 99 | nin 100 | no 101 | non 102 | nos 103 | nosa 104 | nosas 105 | noso 106 | nosos 107 | nós 108 | nun 109 | nunha 110 | nuns 111 | nunhas 112 | o 113 | os 114 | ou 115 | ó 116 | ós 117 | para 118 | pero 119 | pode 120 | pois 121 | pola 122 | polas 123 | polo 124 | polos 125 | por 126 | que 127 | se 128 | senón 129 | ser 130 | seu 131 | seus 132 | sexa 133 | sido 134 | sobre 135 | súa 136 | súas 137 | tamén 138 | tan 139 | te 140 | ten 141 | teñen 142 | teño 143 | ter 144 | teu 145 | teus 146 | ti 147 | tido 148 | tiña 149 | tiven 150 | túa 151 | túas 152 | un 153 | unha 154 | unhas 155 | uns 156 | vos 157 | vosa 158 | vosas 159 | voso 160 | vosos 161 | vós 162 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/lang/stopwords_hy.txt: -------------------------------------------------------------------------------- 1 | # example set of Armenian stopwords. 2 | այդ 3 | այլ 4 | այն 5 | այս 6 | դու 7 | դուք 8 | եմ 9 | են 10 | ենք 11 | ես 12 | եք 13 | է 14 | էի 15 | էին 16 | էինք 17 | էիր 18 | էիք 19 | էր 20 | ըստ 21 | թ 22 | ի 23 | ին 24 | իսկ 25 | իր 26 | կամ 27 | համար 28 | հետ 29 | հետո 30 | մենք 31 | մեջ 32 | մի 33 | ն 34 | նա 35 | նաև 36 | նրա 37 | նրանք 38 | որ 39 | որը 40 | որոնք 41 | որպես 42 | ու 43 | ում 44 | պիտի 45 | վրա 46 | և 47 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/lang/stopwords_th.txt: -------------------------------------------------------------------------------- 1 | # Thai stopwords from: 2 | # "Opinion Detection in Thai Political News Columns 3 | # Based on Subjectivity Analysis" 4 | # Khampol Sukhum, Supot Nitsuwat, and Choochart Haruechaiyasak 5 | ไว้ 6 | ไม่ 7 | ไป 8 | ได้ 9 | ให้ 10 | ใน 11 | โดย 12 | แห่ง 13 | แล้ว 14 | และ 15 | แรก 16 | แบบ 17 | แต่ 18 | เอง 19 | เห็น 20 | เลย 21 | เริ่ม 22 | เรา 23 | เมื่อ 24 | เพื่อ 25 | เพราะ 26 | เป็นการ 27 | เป็น 28 | เปิดเผย 29 | เปิด 30 | เนื่องจาก 31 | เดียวกัน 32 | เดียว 33 | เช่น 34 | เฉพาะ 35 | เคย 36 | เข้า 37 | เขา 38 | อีก 39 | อาจ 40 | อะไร 41 | ออก 42 | อย่าง 43 | อยู่ 44 | อยาก 45 | หาก 46 | หลาย 47 | หลังจาก 48 | หลัง 49 | หรือ 50 | หนึ่ง 51 | ส่วน 52 | ส่ง 53 | สุด 54 | สําหรับ 55 | ว่า 56 | วัน 57 | ลง 58 | ร่วม 59 | ราย 60 | รับ 61 | ระหว่าง 62 | รวม 63 | ยัง 64 | มี 65 | มาก 66 | มา 67 | พร้อม 68 | พบ 69 | ผ่าน 70 | ผล 71 | บาง 72 | น่า 73 | นี้ 74 | นํา 75 | นั้น 76 | นัก 77 | นอกจาก 78 | ทุก 79 | ที่สุด 80 | ที่ 81 | ทําให้ 82 | ทํา 83 | ทาง 84 | ทั้งนี้ 85 | ทั้ง 86 | ถ้า 87 | ถูก 88 | ถึง 89 | ต้อง 90 | ต่างๆ 91 | ต่าง 92 | ต่อ 93 | ตาม 94 | ตั้งแต่ 95 | ตั้ง 96 | ด้าน 97 | ด้วย 98 | ดัง 99 | ซึ่ง 100 | ช่วง 101 | จึง 102 | จาก 103 | จัด 104 | จะ 105 | คือ 106 | ความ 107 | ครั้ง 108 | คง 109 | ขึ้น 110 | ของ 111 | ขอ 112 | ขณะ 113 | ก่อน 114 | ก็ 115 | การ 116 | กับ 117 | กัน 118 | กว่า 119 | กล่าว 120 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/lang/userdict_ja.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This is a sample user dictionary for Kuromoji (JapaneseTokenizer) 3 | # 4 | # Add entries to this file in order to override the statistical model in terms 5 | # of segmentation, readings and part-of-speech tags. Notice that entries do 6 | # not have weights since they are always used when found. This is by-design 7 | # in order to maximize ease-of-use. 8 | # 9 | # Entries are defined using the following CSV format: 10 | # , ... , ... , 11 | # 12 | # Notice that a single half-width space separates tokens and readings, and 13 | # that the number tokens and readings must match exactly. 14 | # 15 | # Also notice that multiple entries with the same is undefined. 16 | # 17 | # Whitespace only lines are ignored. Comments are not allowed on entry lines. 18 | # 19 | 20 | # Custom segmentation for kanji compounds 21 | 日本経済新聞,日本 経済 新聞,ニホン ケイザイ シンブン,カスタム名詞 22 | 関西国際空港,関西 国際 空港,カンサイ コクサイ クウコウ,カスタム名詞 23 | 24 | # Custom segmentation for compound katakana 25 | トートバッグ,トート バッグ,トート バッグ,かずカナ名詞 26 | ショルダーバッグ,ショルダー バッグ,ショルダー バッグ,かずカナ名詞 27 | 28 | # Custom reading for former sumo wrestler 29 | 朝青龍,朝青龍,アサショウリュウ,カスタム人名 30 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/params.json: -------------------------------------------------------------------------------- 1 | {"params":{ 2 | "query":{ 3 | "defType":"edismax", 4 | "q.alt":"*:*", 5 | "rows":"10", 6 | "fl":"*,score", 7 | "":{"v":0}}, 8 | "facets":{ 9 | "facet":"on", 10 | "facet.mincount":"1", 11 | "f.doc_type.facet.mincount":"0", 12 | "facet.field":["text_shingles","{!ex=type}doc_type", "language"], 13 | "f.text_shingles.facet.limit":10, 14 | "facet.query":"{!ex=type key=all_types}*:*", 15 | "f.doc_type.facet.missing":true, 16 | "":{"v":0}}, 17 | "browse":{ 18 | "type_fq":"{!field f=doc_type v=$type}", 19 | "hl":"on", 20 | "hl.fl":"content", 21 | "v.locale":"${locale}", 22 | "debug":"true", 23 | "hl.simple.pre":"HL_START", 24 | "hl.simple.post":"HL_END", 25 | "echoParams": "explicit", 26 | "_appends_": { 27 | "fq": "{!switch v=$type tag=type case='*:*' case.all='*:*' case.unknown='-doc_type:[* TO *]' default=$type_fq}" 28 | }, 29 | "":{"v":0}}, 30 | "velocity":{ 31 | "wt":"velocity", 32 | "v.template":"browse", 33 | "v.layout":"layout", 34 | "":{"v":0}}}} 35 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/protwords.txt: -------------------------------------------------------------------------------- 1 | # The ASF licenses this file to You under the Apache License, Version 2.0 2 | # (the "License"); you may not use this file except in compliance with 3 | # the License. You may obtain a copy of the License at 4 | # 5 | # https://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | #----------------------------------------------------------------------- 14 | # Use a protected word file to protect against the stemmer reducing two 15 | # unrelated words to the same base word. 16 | 17 | # Some non-words that normally won't be encountered, 18 | # just to test that they won't be stemmed. 19 | dontstems 20 | zwhacky 21 | 22 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/stopwords.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/conf/synonyms.txt: -------------------------------------------------------------------------------- 1 | # The ASF licenses this file to You under the Apache License, Version 2.0 2 | # (the "License"); you may not use this file except in compliance with 3 | # the License. You may obtain a copy of the License at 4 | # 5 | # https://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | #----------------------------------------------------------------------- 14 | #some test synonym mappings unlikely to appear in real input text 15 | aaafoo => aaabar 16 | bbbfoo => bbbfoo bbbbar 17 | cccfoo => cccbar cccbaz 18 | fooaaa,baraaa,bazaaa 19 | 20 | # Some synonym groups specific to this example 21 | GB,gib,gigabyte,gigabytes 22 | MB,mib,megabyte,megabytes 23 | Television, Televisions, TV, TVs 24 | #notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming 25 | #after us won't split it into two words. 26 | 27 | # Synonym mappings can be used for spelling correction too 28 | pixima => pixma 29 | 30 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/collection1/core.properties: -------------------------------------------------------------------------------- 1 | name=collection1 2 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/solr.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 28 | 29 | 30 | 31 | 32 | ${host:} 33 | ${jetty.port:8983} 34 | ${hostContext:solr} 35 | ${zkClientTimeout:15000} 36 | ${genericCoreNodeNames:true} 37 | 38 | 39 | 41 | ${socketTimeout:1} 42 | ${connTimeout:1} 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/test/resources/managed-schema/zoo.cfg: -------------------------------------------------------------------------------- 1 | # The number of milliseconds of each tick 2 | tickTime=2000 3 | # The number of ticks that the initial 4 | # synchronization phase can take 5 | initLimit=10 6 | # The number of ticks that can pass between 7 | # sending a request and getting an acknowledgement 8 | syncLimit=5 9 | 10 | # the directory where the snapshot is stored. 11 | # dataDir=/opt/zookeeper/data 12 | # NOTE: Solr defaults the dataDir to /zoo_data 13 | 14 | # the port at which the clients will connect 15 | # clientPort=2181 16 | # NOTE: Solr sets this based on zkRun / zkHost params -------------------------------------------------------------------------------- /src/test/resources/org/springframework/data/solr/repository/ITestSolrRepositoryOperations-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/test/resources/org/springframework/data/solr/repository/config/namespace.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/clustering/carrot2/kmeans-attributes.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/clustering/carrot2/lingo-attributes.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/clustering/carrot2/stc-attributes.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/elevate.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/lang/contractions_ca.txt: -------------------------------------------------------------------------------- 1 | # Set of Catalan contractions for ElisionFilter 2 | # TODO: load this as a resource from the analyzer and sync it in build.xml 3 | d 4 | l 5 | m 6 | n 7 | s 8 | t 9 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/lang/contractions_fr.txt: -------------------------------------------------------------------------------- 1 | # Set of French contractions for ElisionFilter 2 | # TODO: load this as a resource from the analyzer and sync it in build.xml 3 | l 4 | m 5 | t 6 | qu 7 | n 8 | s 9 | j 10 | d 11 | c 12 | jusqu 13 | quoiqu 14 | lorsqu 15 | puisqu 16 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/lang/contractions_ga.txt: -------------------------------------------------------------------------------- 1 | # Set of Irish contractions for ElisionFilter 2 | # TODO: load this as a resource from the analyzer and sync it in build.xml 3 | d 4 | m 5 | b 6 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/lang/contractions_it.txt: -------------------------------------------------------------------------------- 1 | # Set of Italian contractions for ElisionFilter 2 | # TODO: load this as a resource from the analyzer and sync it in build.xml 3 | c 4 | l 5 | all 6 | dall 7 | dell 8 | nell 9 | sull 10 | coll 11 | pell 12 | gl 13 | agl 14 | dagl 15 | degl 16 | negl 17 | sugl 18 | un 19 | m 20 | t 21 | s 22 | v 23 | d 24 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/lang/hyphenations_ga.txt: -------------------------------------------------------------------------------- 1 | # Set of Irish hyphenations for StopFilter 2 | # TODO: load this as a resource from the analyzer and sync it in build.xml 3 | h 4 | n 5 | t 6 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/lang/stemdict_nl.txt: -------------------------------------------------------------------------------- 1 | # Set of overrides for the dutch stemmer 2 | # TODO: load this as a resource from the analyzer and sync it in build.xml 3 | fiets fiets 4 | bromfiets bromfiets 5 | ei eier 6 | kind kinder 7 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/lang/stopwords_ar.txt: -------------------------------------------------------------------------------- 1 | # This file was created by Jacques Savoy and is distributed under the BSD license. 2 | # See http://members.unine.ch/jacques.savoy/clef/index.html. 3 | # Also see https://www.opensource.org/licenses/bsd-license.html 4 | # Cleaned on October 11, 2009 (not normalized, so use before normalization) 5 | # This means that when modifying this list, you might need to add some 6 | # redundant entries, for example containing forms with both أ and ا 7 | من 8 | ومن 9 | منها 10 | منه 11 | في 12 | وفي 13 | فيها 14 | فيه 15 | و 16 | ف 17 | ثم 18 | او 19 | أو 20 | ب 21 | بها 22 | به 23 | ا 24 | أ 25 | اى 26 | اي 27 | أي 28 | أى 29 | لا 30 | ولا 31 | الا 32 | ألا 33 | إلا 34 | لكن 35 | ما 36 | وما 37 | كما 38 | فما 39 | عن 40 | مع 41 | اذا 42 | إذا 43 | ان 44 | أن 45 | إن 46 | انها 47 | أنها 48 | إنها 49 | انه 50 | أنه 51 | إنه 52 | بان 53 | بأن 54 | فان 55 | فأن 56 | وان 57 | وأن 58 | وإن 59 | التى 60 | التي 61 | الذى 62 | الذي 63 | الذين 64 | الى 65 | الي 66 | إلى 67 | إلي 68 | على 69 | عليها 70 | عليه 71 | اما 72 | أما 73 | إما 74 | ايضا 75 | أيضا 76 | كل 77 | وكل 78 | لم 79 | ولم 80 | لن 81 | ولن 82 | هى 83 | هي 84 | هو 85 | وهى 86 | وهي 87 | وهو 88 | فهى 89 | فهي 90 | فهو 91 | انت 92 | أنت 93 | لك 94 | لها 95 | له 96 | هذه 97 | هذا 98 | تلك 99 | ذلك 100 | هناك 101 | كانت 102 | كان 103 | يكون 104 | تكون 105 | وكانت 106 | وكان 107 | غير 108 | بعض 109 | قد 110 | نحو 111 | بين 112 | بينما 113 | منذ 114 | ضمن 115 | حيث 116 | الان 117 | الآن 118 | خلال 119 | بعد 120 | قبل 121 | حتى 122 | عند 123 | عندما 124 | لدى 125 | جميع 126 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/lang/stopwords_cz.txt: -------------------------------------------------------------------------------- 1 | a 2 | s 3 | k 4 | o 5 | i 6 | u 7 | v 8 | z 9 | dnes 10 | cz 11 | tímto 12 | budeš 13 | budem 14 | byli 15 | jseš 16 | můj 17 | svým 18 | ta 19 | tomto 20 | tohle 21 | tuto 22 | tyto 23 | jej 24 | zda 25 | proč 26 | máte 27 | tato 28 | kam 29 | tohoto 30 | kdo 31 | kteří 32 | mi 33 | nám 34 | tom 35 | tomuto 36 | mít 37 | nic 38 | proto 39 | kterou 40 | byla 41 | toho 42 | protože 43 | asi 44 | ho 45 | naši 46 | napište 47 | re 48 | což 49 | tím 50 | takže 51 | svých 52 | její 53 | svými 54 | jste 55 | aj 56 | tu 57 | tedy 58 | teto 59 | bylo 60 | kde 61 | ke 62 | pravé 63 | ji 64 | nad 65 | nejsou 66 | či 67 | pod 68 | téma 69 | mezi 70 | přes 71 | ty 72 | pak 73 | vám 74 | ani 75 | když 76 | však 77 | neg 78 | jsem 79 | tento 80 | článku 81 | články 82 | aby 83 | jsme 84 | před 85 | pta 86 | jejich 87 | byl 88 | ještě 89 | až 90 | bez 91 | také 92 | pouze 93 | první 94 | vaše 95 | která 96 | nás 97 | nový 98 | tipy 99 | pokud 100 | může 101 | strana 102 | jeho 103 | své 104 | jiné 105 | zprávy 106 | nové 107 | není 108 | vás 109 | jen 110 | podle 111 | zde 112 | už 113 | být 114 | více 115 | bude 116 | již 117 | než 118 | který 119 | by 120 | které 121 | co 122 | nebo 123 | ten 124 | tak 125 | má 126 | při 127 | od 128 | po 129 | jsou 130 | jak 131 | další 132 | ale 133 | si 134 | se 135 | ve 136 | to 137 | jako 138 | za 139 | zpět 140 | ze 141 | do 142 | pro 143 | je 144 | na 145 | atd 146 | atp 147 | jakmile 148 | přičemž 149 | já 150 | on 151 | ona 152 | ono 153 | oni 154 | ony 155 | my 156 | vy 157 | jí 158 | ji 159 | mě 160 | mne 161 | jemu 162 | tomu 163 | těm 164 | těmu 165 | němu 166 | němuž 167 | jehož 168 | jíž 169 | jelikož 170 | jež 171 | jakož 172 | načež 173 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/lang/stopwords_el.txt: -------------------------------------------------------------------------------- 1 | # Lucene Greek Stopwords list 2 | # Note: by default this file is used after GreekLowerCaseFilter, 3 | # so when modifying this file use 'σ' instead of 'ς' 4 | ο 5 | η 6 | το 7 | οι 8 | τα 9 | του 10 | τησ 11 | των 12 | τον 13 | την 14 | και 15 | κι 16 | κ 17 | ειμαι 18 | εισαι 19 | ειναι 20 | ειμαστε 21 | ειστε 22 | στο 23 | στον 24 | στη 25 | στην 26 | μα 27 | αλλα 28 | απο 29 | για 30 | προσ 31 | με 32 | σε 33 | ωσ 34 | παρα 35 | αντι 36 | κατα 37 | μετα 38 | θα 39 | να 40 | δε 41 | δεν 42 | μη 43 | μην 44 | επι 45 | ενω 46 | εαν 47 | αν 48 | τοτε 49 | που 50 | πωσ 51 | ποιοσ 52 | ποια 53 | ποιο 54 | ποιοι 55 | ποιεσ 56 | ποιων 57 | ποιουσ 58 | αυτοσ 59 | αυτη 60 | αυτο 61 | αυτοι 62 | αυτων 63 | αυτουσ 64 | αυτεσ 65 | αυτα 66 | εκεινοσ 67 | εκεινη 68 | εκεινο 69 | εκεινοι 70 | εκεινεσ 71 | εκεινα 72 | εκεινων 73 | εκεινουσ 74 | οπωσ 75 | ομωσ 76 | ισωσ 77 | οσο 78 | οτι 79 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/lang/stopwords_en.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # a couple of test stopwords to test that the words are really being 17 | # configured from this file: 18 | stopworda 19 | stopwordb 20 | 21 | # Standard english stop words taken from Lucene's StopAnalyzer 22 | a 23 | an 24 | and 25 | are 26 | as 27 | at 28 | be 29 | but 30 | by 31 | for 32 | if 33 | in 34 | into 35 | is 36 | it 37 | no 38 | not 39 | of 40 | on 41 | or 42 | such 43 | that 44 | the 45 | their 46 | then 47 | there 48 | these 49 | they 50 | this 51 | to 52 | was 53 | will 54 | with 55 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/lang/stopwords_eu.txt: -------------------------------------------------------------------------------- 1 | # example set of basque stopwords 2 | al 3 | anitz 4 | arabera 5 | asko 6 | baina 7 | bat 8 | batean 9 | batek 10 | bati 11 | batzuei 12 | batzuek 13 | batzuetan 14 | batzuk 15 | bera 16 | beraiek 17 | berau 18 | berauek 19 | bere 20 | berori 21 | beroriek 22 | beste 23 | bezala 24 | da 25 | dago 26 | dira 27 | ditu 28 | du 29 | dute 30 | edo 31 | egin 32 | ere 33 | eta 34 | eurak 35 | ez 36 | gainera 37 | gu 38 | gutxi 39 | guzti 40 | haiei 41 | haiek 42 | haietan 43 | hainbeste 44 | hala 45 | han 46 | handik 47 | hango 48 | hara 49 | hari 50 | hark 51 | hartan 52 | hau 53 | hauei 54 | hauek 55 | hauetan 56 | hemen 57 | hemendik 58 | hemengo 59 | hi 60 | hona 61 | honek 62 | honela 63 | honetan 64 | honi 65 | hor 66 | hori 67 | horiei 68 | horiek 69 | horietan 70 | horko 71 | horra 72 | horrek 73 | horrela 74 | horretan 75 | horri 76 | hortik 77 | hura 78 | izan 79 | ni 80 | noiz 81 | nola 82 | non 83 | nondik 84 | nongo 85 | nor 86 | nora 87 | ze 88 | zein 89 | zen 90 | zenbait 91 | zenbat 92 | zer 93 | zergatik 94 | ziren 95 | zituen 96 | zu 97 | zuek 98 | zuen 99 | zuten 100 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/lang/stopwords_ga.txt: -------------------------------------------------------------------------------- 1 | 2 | a 3 | ach 4 | ag 5 | agus 6 | an 7 | aon 8 | ar 9 | arna 10 | as 11 | b' 12 | ba 13 | beirt 14 | bhúr 15 | caoga 16 | ceathair 17 | ceathrar 18 | chomh 19 | chtó 20 | chuig 21 | chun 22 | cois 23 | céad 24 | cúig 25 | cúigear 26 | d' 27 | daichead 28 | dar 29 | de 30 | deich 31 | deichniúr 32 | den 33 | dhá 34 | do 35 | don 36 | dtí 37 | dá 38 | dár 39 | dó 40 | faoi 41 | faoin 42 | faoina 43 | faoinár 44 | fara 45 | fiche 46 | gach 47 | gan 48 | go 49 | gur 50 | haon 51 | hocht 52 | i 53 | iad 54 | idir 55 | in 56 | ina 57 | ins 58 | inár 59 | is 60 | le 61 | leis 62 | lena 63 | lenár 64 | m' 65 | mar 66 | mo 67 | mé 68 | na 69 | nach 70 | naoi 71 | naonúr 72 | ná 73 | ní 74 | níor 75 | nó 76 | nócha 77 | ocht 78 | ochtar 79 | os 80 | roimh 81 | sa 82 | seacht 83 | seachtar 84 | seachtó 85 | seasca 86 | seisear 87 | siad 88 | sibh 89 | sinn 90 | sna 91 | sé 92 | sí 93 | tar 94 | thar 95 | thú 96 | triúr 97 | trí 98 | trína 99 | trínár 100 | tríocha 101 | tú 102 | um 103 | ár 104 | é 105 | éis 106 | í 107 | ó 108 | ón 109 | óna 110 | ónár 111 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/lang/stopwords_gl.txt: -------------------------------------------------------------------------------- 1 | # galican stopwords 2 | a 3 | aínda 4 | alí 5 | aquel 6 | aquela 7 | aquelas 8 | aqueles 9 | aquilo 10 | aquí 11 | ao 12 | aos 13 | as 14 | así 15 | á 16 | ben 17 | cando 18 | che 19 | co 20 | coa 21 | comigo 22 | con 23 | connosco 24 | contigo 25 | convosco 26 | coas 27 | cos 28 | cun 29 | cuns 30 | cunha 31 | cunhas 32 | da 33 | dalgunha 34 | dalgunhas 35 | dalgún 36 | dalgúns 37 | das 38 | de 39 | del 40 | dela 41 | delas 42 | deles 43 | desde 44 | deste 45 | do 46 | dos 47 | dun 48 | duns 49 | dunha 50 | dunhas 51 | e 52 | el 53 | ela 54 | elas 55 | eles 56 | en 57 | era 58 | eran 59 | esa 60 | esas 61 | ese 62 | eses 63 | esta 64 | estar 65 | estaba 66 | está 67 | están 68 | este 69 | estes 70 | estiven 71 | estou 72 | eu 73 | é 74 | facer 75 | foi 76 | foron 77 | fun 78 | había 79 | hai 80 | iso 81 | isto 82 | la 83 | las 84 | lle 85 | lles 86 | lo 87 | los 88 | mais 89 | me 90 | meu 91 | meus 92 | min 93 | miña 94 | miñas 95 | moi 96 | na 97 | nas 98 | neste 99 | nin 100 | no 101 | non 102 | nos 103 | nosa 104 | nosas 105 | noso 106 | nosos 107 | nós 108 | nun 109 | nunha 110 | nuns 111 | nunhas 112 | o 113 | os 114 | ou 115 | ó 116 | ós 117 | para 118 | pero 119 | pode 120 | pois 121 | pola 122 | polas 123 | polo 124 | polos 125 | por 126 | que 127 | se 128 | senón 129 | ser 130 | seu 131 | seus 132 | sexa 133 | sido 134 | sobre 135 | súa 136 | súas 137 | tamén 138 | tan 139 | te 140 | ten 141 | teñen 142 | teño 143 | ter 144 | teu 145 | teus 146 | ti 147 | tido 148 | tiña 149 | tiven 150 | túa 151 | túas 152 | un 153 | unha 154 | unhas 155 | uns 156 | vos 157 | vosa 158 | vosas 159 | voso 160 | vosos 161 | vós 162 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/lang/stopwords_hy.txt: -------------------------------------------------------------------------------- 1 | # example set of Armenian stopwords. 2 | այդ 3 | այլ 4 | այն 5 | այս 6 | դու 7 | դուք 8 | եմ 9 | են 10 | ենք 11 | ես 12 | եք 13 | է 14 | էի 15 | էին 16 | էինք 17 | էիր 18 | էիք 19 | էր 20 | ըստ 21 | թ 22 | ի 23 | ին 24 | իսկ 25 | իր 26 | կամ 27 | համար 28 | հետ 29 | հետո 30 | մենք 31 | մեջ 32 | մի 33 | ն 34 | նա 35 | նաև 36 | նրա 37 | նրանք 38 | որ 39 | որը 40 | որոնք 41 | որպես 42 | ու 43 | ում 44 | պիտի 45 | վրա 46 | և 47 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/lang/stopwords_th.txt: -------------------------------------------------------------------------------- 1 | # Thai stopwords from: 2 | # "Opinion Detection in Thai Political News Columns 3 | # Based on Subjectivity Analysis" 4 | # Khampol Sukhum, Supot Nitsuwat, and Choochart Haruechaiyasak 5 | ไว้ 6 | ไม่ 7 | ไป 8 | ได้ 9 | ให้ 10 | ใน 11 | โดย 12 | แห่ง 13 | แล้ว 14 | และ 15 | แรก 16 | แบบ 17 | แต่ 18 | เอง 19 | เห็น 20 | เลย 21 | เริ่ม 22 | เรา 23 | เมื่อ 24 | เพื่อ 25 | เพราะ 26 | เป็นการ 27 | เป็น 28 | เปิดเผย 29 | เปิด 30 | เนื่องจาก 31 | เดียวกัน 32 | เดียว 33 | เช่น 34 | เฉพาะ 35 | เคย 36 | เข้า 37 | เขา 38 | อีก 39 | อาจ 40 | อะไร 41 | ออก 42 | อย่าง 43 | อยู่ 44 | อยาก 45 | หาก 46 | หลาย 47 | หลังจาก 48 | หลัง 49 | หรือ 50 | หนึ่ง 51 | ส่วน 52 | ส่ง 53 | สุด 54 | สําหรับ 55 | ว่า 56 | วัน 57 | ลง 58 | ร่วม 59 | ราย 60 | รับ 61 | ระหว่าง 62 | รวม 63 | ยัง 64 | มี 65 | มาก 66 | มา 67 | พร้อม 68 | พบ 69 | ผ่าน 70 | ผล 71 | บาง 72 | น่า 73 | นี้ 74 | นํา 75 | นั้น 76 | นัก 77 | นอกจาก 78 | ทุก 79 | ที่สุด 80 | ที่ 81 | ทําให้ 82 | ทํา 83 | ทาง 84 | ทั้งนี้ 85 | ทั้ง 86 | ถ้า 87 | ถูก 88 | ถึง 89 | ต้อง 90 | ต่างๆ 91 | ต่าง 92 | ต่อ 93 | ตาม 94 | ตั้งแต่ 95 | ตั้ง 96 | ด้าน 97 | ด้วย 98 | ดัง 99 | ซึ่ง 100 | ช่วง 101 | จึง 102 | จาก 103 | จัด 104 | จะ 105 | คือ 106 | ความ 107 | ครั้ง 108 | คง 109 | ขึ้น 110 | ของ 111 | ขอ 112 | ขณะ 113 | ก่อน 114 | ก็ 115 | การ 116 | กับ 117 | กัน 118 | กว่า 119 | กล่าว 120 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/lang/userdict_ja.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This is a sample user dictionary for Kuromoji (JapaneseTokenizer) 3 | # 4 | # Add entries to this file in order to override the statistical model in terms 5 | # of segmentation, readings and part-of-speech tags. Notice that entries do 6 | # not have weights since they are always used when found. This is by-design 7 | # in order to maximize ease-of-use. 8 | # 9 | # Entries are defined using the following CSV format: 10 | # , ... , ... , 11 | # 12 | # Notice that a single half-width space separates tokens and readings, and 13 | # that the number tokens and readings must match exactly. 14 | # 15 | # Also notice that multiple entries with the same is undefined. 16 | # 17 | # Whitespace only lines are ignored. Comments are not allowed on entry lines. 18 | # 19 | 20 | # Custom segmentation for kanji compounds 21 | 日本経済新聞,日本 経済 新聞,ニホン ケイザイ シンブン,カスタム名詞 22 | 関西国際空港,関西 国際 空港,カンサイ コクサイ クウコウ,カスタム名詞 23 | 24 | # Custom segmentation for compound katakana 25 | トートバッグ,トート バッグ,トート バッグ,かずカナ名詞 26 | ショルダーバッグ,ショルダー バッグ,ショルダー バッグ,かずカナ名詞 27 | 28 | # Custom reading for former sumo wrestler 29 | 朝青龍,朝青龍,アサショウリュウ,カスタム人名 30 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/protwords.txt: -------------------------------------------------------------------------------- 1 | # The ASF licenses this file to You under the Apache License, Version 2.0 2 | # (the "License"); you may not use this file except in compliance with 3 | # the License. You may obtain a copy of the License at 4 | # 5 | # https://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | #----------------------------------------------------------------------- 14 | # Use a protected word file to protect against the stemmer reducing two 15 | # unrelated words to the same base word. 16 | 17 | # Some non-words that normally won't be encountered, 18 | # just to test that they won't be stemmed. 19 | dontstems 20 | zwhacky 21 | 22 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/scripts.conf: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | user= 17 | solr_hostname=localhost 18 | solr_port=8983 19 | rsyncd_port=18983 20 | data_dir= 21 | webapp_name=solr 22 | master_host= 23 | master_data_dir= 24 | master_status_dir= 25 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/spellings.txt: -------------------------------------------------------------------------------- 1 | pizza 2 | history -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/stopwords.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/conf/synonyms.txt: -------------------------------------------------------------------------------- 1 | # The ASF licenses this file to You under the Apache License, Version 2.0 2 | # (the "License"); you may not use this file except in compliance with 3 | # the License. You may obtain a copy of the License at 4 | # 5 | # https://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | #----------------------------------------------------------------------- 14 | #some test synonym mappings unlikely to appear in real input text 15 | aaafoo => aaabar 16 | bbbfoo => bbbfoo bbbbar 17 | cccfoo => cccbar cccbaz 18 | fooaaa,baraaa,bazaaa 19 | 20 | # Some synonym groups specific to this example 21 | GB,gib,gigabyte,gigabytes 22 | MB,mib,megabyte,megabytes 23 | Television, Televisions, TV, TVs 24 | #notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming 25 | #after us won't split it into two words. 26 | 27 | # Synonym mappings can be used for spelling correction too 28 | pixima => pixma 29 | 30 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/collection1/core.properties: -------------------------------------------------------------------------------- 1 | name=collection1 2 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/solr.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 28 | 29 | 30 | 31 | 32 | ${host:} 33 | ${jetty.port:8983} 34 | ${hostContext:solr} 35 | ${zkClientTimeout:15000} 36 | ${genericCoreNodeNames:true} 37 | 38 | 39 | 41 | ${socketTimeout:1} 42 | ${connTimeout:1} 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/test/resources/static-schema/zoo.cfg: -------------------------------------------------------------------------------- 1 | # The number of milliseconds of each tick 2 | tickTime=2000 3 | # The number of ticks that the initial 4 | # synchronization phase can take 5 | initLimit=10 6 | # The number of ticks that can pass between 7 | # sending a request and getting an acknowledgement 8 | syncLimit=5 9 | 10 | # the directory where the snapshot is stored. 11 | # dataDir=/opt/zookeeper/data 12 | # NOTE: Solr defaults the dataDir to /zoo_data 13 | 14 | # the port at which the clients will connect 15 | # clientPort=2181 16 | # NOTE: Solr sets this based on zkRun / zkHost params --------------------------------------------------------------------------------