Prerequisites Install Solr using Docker



Download 31,97 Kb.
Sana18.02.2023
Hajmi31,97 Kb.
#912644
Bog'liq
Homework (4)


Prerequisites

  1. Install Solr using Docker: https://hub.docker.com/_/solr

  2. Java version 8+

  3. Maven

  4. Java IDE

Task 1 - Indexing (2 Points)

  1. Find collection of the books in English language. It is better to use epub format.

  2. Implement indexing process of these books.

  3. Document should have the following fields: - Id - Title (book title, string) - Authors (collection of strings) - Content - Language

  4. The process of indexing could be described as following: - Read all books from local folder - Use epubreader library (ex. com.positiondev.epublib) for transforming from File to EbubBook object - Then transform EpubBook to Book model which represent Solr document - Save Books to Solr

  5. Implement API endpoint to start indexing process

  6. Using spring data solr implement repository to retrieving solr document by id

  7. Implement API endpoint

GET /api/v1/book/{id}
Task 2 - Search book by query (2 points)

  1. Implement API endpoint with following request:

{
"field": "string", // field for filtering
"value": "string", // value of the field for filtering
"facetField": "string", // field for facet
"fulltext": true, // is full text search
"q": "string" // query for full text search
}
The response structure is:
{
"books": [
{
"id": "string",
"authors": [
"string"
],
"title": "string",
"language": "string",
"content": "string",
}
],
"facets": [
{
"valueCount": 0,
"value": "string",
"field": {
"name": "string"
},
"key": {
"name": "string"
}
}
],
"numFound": 0
}

  1. Using *org.springframework.data.solr.core.SolrTemplate * implement search request to Solr using parameters from response

Task 3 - Implement autosuggestions (1 Point)

  1. Implement API endpoint which is returning array of suggestions:

GET api/v1/book/suggest?query=

  1. Create suggest field in scheme using org.springframework.data.solr.core.SolrTemplate which is filled from Book.title & Book.authors

  2. Add required searchComponent and requestHandler for suggestions to solrconfig.xml

  3. Using org.apache.solr.client.solrj.SolrClient execute suggest query

Download 31,97 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish