'multi'에 해당되는 글 4건

  1. 2021.08.18 [Java] html strip + multi whitespace strip
  2. 2021.02.22 [Spring] 멀티모듈 프로젝트 jar SKIPPED
  3. 2017.07.17 [Elasticsearch] Multi Search API 사용
  4. 2017.01.19 [Lucene] Multi-value fields and the inverted index

[Java] html strip + multi whitespace strip

ITWeb/개발일반 2021. 8. 18. 11:30
content = content.replaceAll("<[^>]*>", "");  // html strip
content = content.replaceAll("( )+", " " );   // multi whitespace to single whitespace

사용할 일이 있는데 기억력이 떨어져서 기록 해 봅니다.

:

[Spring] 멀티모듈 프로젝트 jar SKIPPED

ITWeb/개발일반 2021. 2. 22. 18:24

intellij community 를 사용하고 있는데 다른 사람은 다 되는게 나만 안되어서 설정을 고쳐서 해결 했습니다.

다른 사람들은 intellij ultimate 사용 하고 있습니다.

 

Multi module web 프로젝트 실행 시 submodule 만 동작해서 원인을 찾아 보고 해결했습니다.

 

원인은)

> Task :base:compileJava UP-TO-DATE
> Task :base:processResources NO-SOURCE
> Task :base:classes UP-TO-DATE
> Task :base:jar SKIPPED
> Task :custom:compileJava UP-TO-DATE
> Task :custom:processResources NO-SOURCE
> Task :custom:classes UP-TO-DATE

 

해결은)

project(":base") {
  jar{
    enabled = true
  }
}

 

근데 왜 나만 저렇게 설정을 해줘야 하는지는 못 찾았습니다.

아시는 분은 제보 좀...

:

[Elasticsearch] Multi Search API 사용

Elastic/Elasticsearch 2017. 7. 17. 12:48

2.X 랑 5.X 랑 크게 바뀐 부분은 없습니다.

다만 5.X 에서는 template 지원도 함께 됩니다.


참고문서)

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html


Multi Search API를 얼마나 많은 분들이 사용하고 계신지는 잘 모르겠습니다.

이 API 를 한 줄로 정의 하면 "통합 검색 API" 라고 할 수 있습니다.

뭐 동의 하지 않으시는 분들이 계시다면 어쩔수 없구요.


설명을 풀어서 하면, 서로 다른 query 를 하나의 index 에 질의 하거나 하나의 query 를 서로 다른 index 로 질의 할 때 사용 하시면 유용 합니다.


Case 1)

Single Query + Multi Index


Case 2)

Multi Query + Single Index


Case 3)

Multi Query + Multi Index


위 참고문서 에서는 Request 에 대한 내용은 나와 있지만 실제 Response 에 대한 예시는 나와 있지 않아 실제 실행 보지 않고서는 어떻게 결과가 나올지 모르실 수도 있습니다.

(사실 상상은 되실거예요.)


아래는 제가 테스트로 하나의 클러스터에 "Case 3" 으로 실행한 결과 입니다.


Request API)

Endpoint : http://xxxx/_msearch

Method : POST (raw)


Request Query)

{"index":"service_product"}

{"query":{"match_all":{}},"from":0,"size":1}

{"index":"service_item"}

{"query":{"term":{"title":{"value":"틴트"}}},"from":0,"size":1}


Response Data)

{

    "responses": [

        {

            "took": 1,

            "timed_out": false,

            "_shards": {

                "total": 1,

                "successful": 1,

                "failed": 0

            },

            "hits": {

                "total": xxxxxx,

                "max_score": 1,

                "hits": [

                    {

                        "_index": "service_product_201707171215",

                        "_type": "deal",

                        "_id": "7510",

                        "_score": 1,

                        "_source": {

                        ... 생략 ...

                        }

                    }

                ]

            }

        },

        {

            "took": 1,

            "timed_out": false,

            "_shards": {

                "total": 1,

                "successful": 1,

                "failed": 0

            },

            "hits": {

                "total": xxxxxx,

                "max_score": 7.0183215,

                "hits": [

                    {

                        "_index": "service_item_201707171215",

                        "_type": "item",

                        "_id": "1170617",

                        "_score": 7.0183215,

                        "_source": {

                            ... 중략 ...

                            "title": "라네즈 투톤틴트바 No.3 2g 틴트민트",

                            ... 중략 ...

                        }

                    }

                ]

            }

        }

    ]

}


결과적으로 보면, 검색엔진에서 해당 연산과 실행을 하실지 아니면 별도 API Gateway 같은 WAS 에서 연산과 실행을 하실지에 대한 문제로 트래픽과 용량을 잘 산정 하셔서 사용하시면 매우 유용하리라 생각 합니다.

(너무 오래 전에 비슷한 내용을 올린 것 같아 5.5 릴리즈 기념으로 한번 더 복습해 봤습니다.)


:

[Lucene] Multi-value fields and the inverted index

ITWeb/검색일반 2017. 1. 19. 18:41
아주 기초적인 것도 잊어버리는 것 같아 기록해 봅니다.

Multi-value fields and the inverted index

The fact that all field types support multi-value fields out of the box is a consequence of the origins of Lucene. Lucene was designed to be a full text search engine. In order to be able to search for individual words within a big block of text, Lucene tokenizes the text into individual terms, and adds each term to the inverted index separately.

This means that even a simple text field must be able to support multiple values by default. When other datatypes were added, such as numbers and dates, they used the same data structure as strings, and so got multi-values for free.


이 글은 아래 elasticsearch 에서 퍼왔습니다.


[문서]

https://www.elastic.co/guide/en/elasticsearch/reference/2.4/array.html

: