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:

https://www.my-dev-site.company.com/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

1 Answer 1

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

Example

plugin.tx_solr {
    search {
        faceting {
            facets {
                myfilter{
                    field = type_stringS
                }
            }
        }
    }
    index {
        queue {
            pages {
                fields {
                    type_stringS = TEXT
                    type_stringS.value = page
                }
            }
            tx_company_z_pressphotos {
                fields {
                    type_stringS = TEXT
                    type_stringS.value = myPressphotosLabel
                }
            }
        }
    }
}
Sign up to request clarification or add additional context in comments.

2 Comments

Do you have a practical example to start with? I only find old stuff like this stackoverflow.com/questions/64975694/… and I can't get any further with the documentation. docs.typo3.org/p/apache-solr-for-typo3/solr/main/en-us/Appendix/… Sometimes I wonder if it's just me having this problem or if I'm just missing something and it's actually super simple. ^^
I cannout upvote your answer. "You need at least 15 reputation to cast a vote, but your feedback has been recorded." but at least I tried. Thanks man! ^_^

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.