6
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

FessAdvent Calendar 2016

Day 4

Fess フィールドを追加する

Posted at

Fess 10.3でフィールドを追加してみます。

  • Fessにフィールドを追加
  • 追加フィールドにCSVファイルのセルのデータを投入
  • 追加フィールドで検索

CSVファイル

"Path","Track_No","Artist","Track","Remix"
"file:///Music/iTunes/iTunes Media/Music/Unknown Artist/Unknown Album/Cusp - Adam.mp3","","Cusp","Adam",""
"file:///Music/iTunes/iTunes Media/Music/Ruins/Shallows/05 Gradient (Beach Club & Relic Remix).mp3","05","Ruins","Grandient","Beach Club & Relic Remix"
"file:///Music/iTunes/iTunes Media/Music/Ruins/Shallows/04 Nu Guinea (Simpig Remix).mp3","04","Ruins","Nu Guinea","Simpig"
"file:///Music/iTunes/iTunes Media/Music/Ruins/Shallows/02 Gradient.mp3","02","Ruins","Gradient",""
"file:///Music/iTunes/iTunes Media/Music/Kozmo & Subduktion/Happy Hour/04 Kozmo & Subduktion - Gin & Tonic (A.Fruit Remix).mp3","","Kozmo & Subduktion","Gin & Tonic","A.Fruit"
"file:///Music/iTunes/iTunes Media/Music/Rattraps/Swan Dive/02 Vanilla Sky.mp3","02","Rattraps","Vanilla Sky",""
"file:///Music/iTunes/iTunes Media/Music/Rattraps/Swan Dive/01 Swan Dive.mp3","01","Rattraps","Swan Dive",""
"file:///Music/iTunes/iTunes Media/Music/Unknown Artist/Unknown Album/Lux Familiar - Risk Game.mp3","","Lux Familiar","Risk Game",""
"file:///Music/iTunes/iTunes Media/Music/broken haze/TRD - EP/01 Supra.m4a","01","Broken Haze","Supra",""
"file:///Music/iTunes/iTunes Media/Music/broken haze/TRD - EP/02 MR2.m4a","02","Broken Haze","MR2",""

フィールド追加

track,artist,remix,track_noのフィールドを追加します。

app/WEB-INF/classes/fess_config.properties

  1. response, search, facetに追加するフィールドを記述します。
  2. Fessを再起動します。
fess_config.properties
query.additional.response.fields=track,artist,remix,track_no
query.additional.api.response.fields=
query.additional.cache.response.fields=
query.additional.highlighted.fields=
query.additional.search.fields=track,artist,remix,track_no
query.additional.facet.fields=track,artist,remix,track_no
query.additional.sort.fields=
query.additional.not.analyzed.fields=

データストアクロール(CsvDataStore)

管理画面>クローラ>データストア>新規作成

ハンドラ名
CsvDataStore
パラメータ
directories=/opt/fileDir/csvlist (CSVファイルを配置したディレクトリを記述)
fileEncoding=UTF-8
hasHeaderLine=true
quoteDisabled=false
ignoreEmptyLines=true
escapeDisabled=false
スクリプト
url=cell1
track_no=cell2
artist=cell3
track=cell4
remix=cell5
title=track_no+" "+artist+" - "+track+" "+remix
content=track_no+" "+artist+" - "+track+" "+remix+" "+url
digest=track_no+" "+artist+" - "+track+" "+remix
anchor=
content_length=crawlingContext.get("responseData").get("content_length")
last_modified=crawlingContext.get("responseData").get("last_modified")
created=crawlingContext.get("responseData")

追加したフィールドで検索

フィールド指定の検索は 追加フィールド名:検索語 で行います。
track_no:01 と検索することでトラック番号が01のデータがヒットします。

スクリーンショット 2016-11-22 17.36.17.png
6
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?