Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Solr 4: Introdução
e Faceted Search
Michel Bottan
michel.bottan@elo7.com
TDC 2014 São Paulo
Quem sou ?
● Software Craftsman nos Greyjoy da Elo7
● Empreendedor e co-founder da Comune
● Experiência com Solr na Abril ...
Information Retrieval (IR)
“Information retrieval is the activity of obtaining information
resources relevant to an inform...
O que é ?
O que é ?
Solr é uma plataforma de busca open source confiável,
escalável e tolerante a falha.
Apache Lucene Pro...
Engine de busca textual
● Lucene criado em 1999 por Doug Cutting, mesmo criador do
Nutch e Hadoop.
● Solr criado 2004 por ...
Features
● Full-text search
● Hit hightlighting
● Faceted search
● Fuzzy / Proximity search
● Near real-time indexing
● Da...
Interface HTTP
Query e Indexação
Query Parsing
Text Analysis
Search Components
● Facets
● Filtering
● Geospatial
● Spellin...
Pipeline indexação
{
"id":"ABC_123",
"title":"Zen zazen"
...
}
Tokenizer Filter
Documento
Post
/update
Field Analyzer inde...
Índice invertido
Schema Design
● Campos definidos: explicitamente declarados na configuração
<field name="preco" type="float" default="0.0"...
Query syntax
● Query single e multi term
○ nome_campo: valor ou titulo:casamento
● Operadores +, -, AND, OR NOT
○ titulo: ...
● tf (t in d): frequência do termo no documento
○ número de vezes que o termo t aparece no documento d
○ documentos com ma...
O que é Faceted Search?
● Não força hierarquia de
opções
○ usuário pode aplicar e
remover filtros de facets
em qualquer ordem
● Sem surpresas
○ us...
● Cada busca realizada é indexada como um documento.
+1milhão de buscas de usuários por dia
{ id: "10c8be8e-2d75-4c07-ad17...
Indexação para Facets
● Facet é feito no valor indexado e não no stored
● Indexação
○ Não tokenizado em palavras separadas...
● Especifica campo para facet
● Cada termo indexado no campo é uma constraint
● Campo deve ser indexado
● Pode ser usado m...
http://..:8983/solr/search-metrics/select?q=*:*&fq=page:1&wt=json&facet=true&facet.field=keyword&rows=0
Field Value Faceti...
http://..:8983/solr/search-metrics/select?q=*:*&fq=page:1&fq=keyword:lembrancinha&facet=true&facet.field=sort
Field Value ...
● facet.prefix - Restringe à valores indexados com o prefixo.
● facet.mincount = 0 - Número mínimo de contadores
● facet.s...
● Especifica uma query arbitrária no formato do Lucene
● Multiplas queries com restrições
Query Faceting
facet.query=time:...
● Cria intervalos uniformemente dimensionados
● Ranges de data são especificados usando expressões
“DateMath”
● Usado em c...
● Filtra os resultados, mas permite preservar os resultados
de facets
● Permite colocar tag no filtro
● Permite excluir ce...
Pivot Faceting (Solr 4+)
● Realiza um facet dentro dos resultados de um facet pai
facet=true
fq=page:1
&facet.pivot=city,k...
Obrigado!
Estamos contratando!
jobs@elo7.com
Blog de Engenharia
craftedbits.elo7.com.br
Upcoming SlideShare
Loading in …5
×

Introdução ao Solr e Faceted Search

2,124 views

Published on

Introdução ao Solr e Faceted Search. Case Elo7 de métricas de busca baseada em Solr.

Published in: Technology
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Introdução ao Solr e Faceted Search

  1. 1. Solr 4: Introdução e Faceted Search Michel Bottan michel.bottan@elo7.com TDC 2014 São Paulo
  2. 2. Quem sou ? ● Software Craftsman nos Greyjoy da Elo7 ● Empreendedor e co-founder da Comune ● Experiência com Solr na Abril Digital, Comune e Elo7. ● Entusiasta de negócios de impacto social ○ Elo7 é um marketplace com +60mil vendedores. Agenda ● Introdução ao Solr ● Faceted Search case Elo7
  3. 3. Information Retrieval (IR) “Information retrieval is the activity of obtaining information resources relevant to an information need from a collection of information resources. Searches can be based on metadata or on full-text (or other content-based) indexing.” --Wikipedia
  4. 4. O que é ? O que é ? Solr é uma plataforma de busca open source confiável, escalável e tolerante a falha. Apache Lucene Project Engine de busca textual de alta-performance em Java. Open source e seu core pode ser usado independente do Solr.
  5. 5. Engine de busca textual ● Lucene criado em 1999 por Doug Cutting, mesmo criador do Nutch e Hadoop. ● Solr criado 2004 por Yonik Seeley ● Em 2010, projetos Lucene e Solr mergeados ● Solr e Lucene versão 4.9.0 ● Mesmo time de desenvolvedores. ● Backed by Lucid Imagination Histórico
  6. 6. Features ● Full-text search ● Hit hightlighting ● Faceted search ● Fuzzy / Proximity search ● Near real-time indexing ● Database integration ● Rich document handling ● Geospatial search
  7. 7. Interface HTTP Query e Indexação Query Parsing Text Analysis Search Components ● Facets ● Filtering ● Geospatial ● Spelling ● More Like This Caching Admin DIH - Data Import Handler Index Replication Index Searcher / Writer Query Parser Arquitetura
  8. 8. Pipeline indexação { "id":"ABC_123", "title":"Zen zazen" ... } Tokenizer Filter Documento Post /update Field Analyzer indexação/query Lucene Inverted Index Alianças de casamento WhitespaceTokenizer Alianças de casamento LowercaseFilter alianças de casamento StopwordFilter alianças casamento PortugueseLightStemmerFilter alianc casament
  9. 9. Índice invertido
  10. 10. Schema Design ● Campos definidos: explicitamente declarados na configuração <field name="preco" type="float" default="0.0" indexed="true" stored="true"/> ● Campos dinâmicos: sufixo determina o tipo do campo <dynamicField name="*_i" type="int" indexed="true" stored="true"/> ● Campos copiados: campo de origem e destino <copyField source="cat" dest="text" maxChars="30000" /> ● Schemaless Mode: Solr infere o tipo na primeira chamada e cria um schema dinâmicamente
  11. 11. Query syntax ● Query single e multi term ○ nome_campo: valor ou titulo:casamento ● Operadores +, -, AND, OR NOT ○ titulo: (software AND engineer) ● Range queries: em campos númericos e data ○ timestamp: [ * TO NOW ] ou preco: [ 1 TO 100 ] ● Boost queries: ○ titulo:Lembrancinha ^1.5 OR text:Lembrancinha ● Fuzzy search: busca por palavras com grafia semelhante ○ calda ~0.8 => cauda ● Proximity Search: phrase query menos restrita. Quanto mais perto os termos, maior o score. ○ “apache lucene”~20
  12. 12. ● tf (t in d): frequência do termo no documento ○ número de vezes que o termo t aparece no documento d ○ documentos com mais ocorrências do termo t recebem maior score ● idf (t): frequência inversa do documento ○ inverso da docFreq (número de documentos em que o termo t aparece) ○ quanto mais raro o termo t maior o score documento ● coord: quantos dos termos buscados são encontrados no documento ○ quantos mais termos t aparecem no documento, maior o score do documento ● boost (index) : boost num campo em tempo de indexação ● boost (query) : boost no campo em tempo de busca Relevância
  13. 13. O que é Faceted Search?
  14. 14. ● Não força hierarquia de opções ○ usuário pode aplicar e remover filtros de facets em qualquer ordem ● Sem surpresas ○ usuário sabe o que esperar antes de aplicar o filtro Faceted Search
  15. 15. ● Cada busca realizada é indexada como um documento. +1milhão de buscas de usuários por dia { id: "10c8be8e-2d75-4c07-ad17-20ebd0a17ad2", keyword: "Organizador de Bolsa", keyword_original: "Organizador de Bolsa", user: “buyer”, page: 2, hits: 3326, time: 7,… } ● Solr pré-processa e normaliza termos de busca. ○ alianças casamento, aliança casamento, alianca casamento ● Métricas quase real time. Barato, simples e escalável (por um tempo)! Métricas de busca
  16. 16. Indexação para Facets ● Facet é feito no valor indexado e não no stored ● Indexação ○ Não tokenizado em palavras separadas ○ Não mapeado para lowercase ○ Humam-readable, acentuação não removida
  17. 17. ● Especifica campo para facet ● Cada termo indexado no campo é uma constraint ● Campo deve ser indexado ● Pode ser usado múltiplas vezes Field Value Faceting q=*:* fq = page:1 facet = true facet.field = keyword facet.field = city
  18. 18. http://..:8983/solr/search-metrics/select?q=*:*&fq=page:1&wt=json&facet=true&facet.field=keyword&rows=0 Field Value Faceting: Resultados facet_counts: { facet_queries: { }, facet_fields: { keyword: [ "lembrancinha", 125629, "bebe", 106350, "casamento", 103706, "aniversario e festa", 102394, "decoracao", 77442, "lembrancinhas de aniversario",75603, "lembrancinhas de casamento", 55003, "bebe reborn", 42638, "convites de casamento",42538, "convite", 40690 …. 1ª - QTime: 1750 2ª - QTime: 500
  19. 19. http://..:8983/solr/search-metrics/select?q=*:*&fq=page:1&fq=keyword:lembrancinha&facet=true&facet.field=sort Field Value Faceting: Filtrando facet_counts: { facet_queries: { }, facet_fields: { sort: [ "featured", 105081, "relevance", 18976, "minprice", 1245, "maxprice", 143, "newest", 139, "unsorted", 30, "oldest", 13, "organic", 2 …. 1ª - QTime: 1927 2ª - QTime: 13
  20. 20. ● facet.prefix - Restringe à valores indexados com o prefixo. ● facet.mincount = 0 - Número mínimo de contadores ● facet.sort = count, index - Ordenação por quantidade ou lexicográfica ● facet.offset = 0 - Quantos resultados devem ser escapados. ● facet.limit = 100 - Número de resultados ● facet.missing = false – Número de documentos sem valor indexado Parâmetros facet.field
  21. 21. ● Especifica uma query arbitrária no formato do Lucene ● Multiplas queries com restrições Query Faceting facet.query=time:[* TO 50] facet.query=time:[50 TO 200] facet.query=time:[200 TO *] … facet_queries: { time:[* TO 50]: 25985897, time:[50 TO 200]: 3273294, time:[200 TO *]: 529980 } …
  22. 22. ● Cria intervalos uniformemente dimensionados ● Ranges de data são especificados usando expressões “DateMath” ● Usado em campos numéricos e data Range Faceting facet.range: "created_at" facet.range.start: "NOW/YEAR-1YEAR" facet.range.end: "NOW/MONTH+1MONTH" facet.range.gap: "+1DAY" … facet_ranges: { created_at: { ... "2014-07-28T00:00:00Z", 1030403, "2014-07-29T00:00:00Z", 966961, "2014-07-30T00:00:00Z", 904438 … } } …
  23. 23. ● Filtra os resultados, mas permite preservar os resultados de facets ● Permite colocar tag no filtro ● Permite excluir certos filtros quando fizer facet Multi-select Faceting facet=true fq=page:1 fq={!tag=kw}keyword:lembrancinha facet.field={!ex=kw}keyword … facet_fields: { keyword:[ "lembrancinha", 125629, "bebe", 106350, "casamento", 103706, "aniversario e festa", 102394, "decoracao", 77442, ... }
  24. 24. Pivot Faceting (Solr 4+) ● Realiza um facet dentro dos resultados de um facet pai facet=true fq=page:1 &facet.pivot=city,keyword … facet_pivot: { city_keyword: [ { field: "city",value: "são paulo", count: 8921, pivot: [ { field: "keyword", value: "convites de casamento", count: 217 },{ field: "keyword", value: "lembrancinha", count: 140 },{ field: "keyword",value: "bebe reborn", count: 74 }, ...
  25. 25. Obrigado! Estamos contratando! jobs@elo7.com Blog de Engenharia craftedbits.elo7.com.br

×