最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

indexing - TYPO3 12 with SOLR - readable URL - Stack Overflow

programmeradmin4浏览0评论

One of my IndexQueues looks like this

plugin.tx_solr.index.queue {
    pressphotos = 1
    pressphotos {
        type = tx_company_z_pressphotos
        label = myPressphotosLabel
        fields {
            title = title
            datetime_stringS = TEXT
            datetime_stringS {
                field = record_date
                date = Y-m-d
            }
            content = SOLR_CONTENT
            content {
                cObject = COA
                cObject {
                    10 = TEXT
                    10 {
                        field = text
                        noTrimWrap = || |
                    }
                }
            }
            url = TEXT
            url {
                typolink.parameter = {$pid.detail.pressphotos}
                typolink.additionalParams.insertData = 1
                typolink.useCacheHash = 1
                typolink.returnLast = url
                typolink.linkAccessRestrictedPages = 1
            }
        }
    }
}

and it's all well and good. I can search stuff, works like a charm. Only thing "missing" is a nice URL.
I cannot change the name of the table and TYPO3 / SOLR takes it as the value. That's why I got the search result URL:

/?tx_solr[q]=JohnDoe&photofilter=tx_company_z_pressphotos

and I want there to be a readable variant like &photofilter=myPressphotosLabel instead of the tablename "tx_company_z_pressphotos".

I tried using renderingInstruction but that only changes the output on the frontend, URL still is the same.

plugin {
    tx_solr {
        search {
            faceting = 1
            faceting {
                facets {
                    myfilter{
                        label = Filter
                        field = type

                        renderingInstruction = CASE
                        renderingInstruction {
                            key.field = optionValue

                            tx_company_z_pressphotos= TEXT
                            tx_company_z_pressphotos.value = photofilter
                    
                        }
                    }
                }
            }
        }
    }
}

and I add my filters with this

<input type="checkbox" class="activated" value="">
    <a class="facet solr-ajaxified" href="{s:uri.facet.addFacetItem(facet: facet, facetItem: option)}">
        <f:translate key="solr.content-type.plural.{option.label}" extensionName="myExtension"/> 
    </a>
</input>

I have the TYPO3 documentation for SOLR, IndexQueue and Routing at hand but I don't get what I'm missing. I thought that's what the Indexqueue Label was for but he keeps using the table name. And I couldn't solve it using routing either. In other TYPO3-Routings this was implemented via "aspects", but this doesn't seem to be the working with SOLR.

And on a sidenote: is it possible to replace the "tx_solr[q]" as well? That would be the cherry on top. :)

Thanks.
TZP

One of my IndexQueues looks like this

plugin.tx_solr.index.queue {
    pressphotos = 1
    pressphotos {
        type = tx_company_z_pressphotos
        label = myPressphotosLabel
        fields {
            title = title
            datetime_stringS = TEXT
            datetime_stringS {
                field = record_date
                date = Y-m-d
            }
            content = SOLR_CONTENT
            content {
                cObject = COA
                cObject {
                    10 = TEXT
                    10 {
                        field = text
                        noTrimWrap = || |
                    }
                }
            }
            url = TEXT
            url {
                typolink.parameter = {$pid.detail.pressphotos}
                typolink.additionalParams.insertData = 1
                typolink.useCacheHash = 1
                typolink.returnLast = url
                typolink.linkAccessRestrictedPages = 1
            }
        }
    }
}

and it's all well and good. I can search stuff, works like a charm. Only thing "missing" is a nice URL.
I cannot change the name of the table and TYPO3 / SOLR takes it as the value. That's why I got the search result URL:

https://www.my-dev-sitepany/search/?tx_solr[q]=JohnDoe&photofilter=tx_company_z_pressphotos

and I want there to be a readable variant like &photofilter=myPressphotosLabel instead of the tablename "tx_company_z_pressphotos".

I tried using renderingInstruction but that only changes the output on the frontend, URL still is the same.

plugin {
    tx_solr {
        search {
            faceting = 1
            faceting {
                facets {
                    myfilter{
                        label = Filter
                        field = type

                        renderingInstruction = CASE
                        renderingInstruction {
                            key.field = optionValue

                            tx_company_z_pressphotos= TEXT
                            tx_company_z_pressphotos.value = photofilter
                    
                        }
                    }
                }
            }
        }
    }
}

and I add my filters with this

<input type="checkbox" class="activated" value="">
    <a class="facet solr-ajaxified" href="{s:uri.facet.addFacetItem(facet: facet, facetItem: option)}">
        <f:translate key="solr.content-type.plural.{option.label}" extensionName="myExtension"/> 
    </a>
</input>

I have the TYPO3 documentation for SOLR, IndexQueue and Routing at hand but I don't get what I'm missing. I thought that's what the Indexqueue Label was for but he keeps using the table name. And I couldn't solve it using routing either. In other TYPO3-Routings this was implemented via "aspects", but this doesn't seem to be the working with SOLR.

And on a sidenote: is it possible to replace the "tx_solr[q]" as well? That would be the cherry on top. :)

Thanks.
TZP

Share Improve this question asked yesterday TZPTZP 13 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

queue.[indexConfig].type is a predefined field and can't be modified. A good practice for your use case is defining an additional field typeName or so.

Then, you only have to reconfigure the filter not using type but typeName

发布评论

评论列表(0)

  1. 暂无评论